Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oculus Touch controller bindings #92

Open
BattleAxeVR opened this issue Mar 19, 2024 · 2 comments
Open

Oculus Touch controller bindings #92

BattleAxeVR opened this issue Mar 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@BattleAxeVR
Copy link
Contributor

BattleAxeVR commented Mar 19, 2024

Hi, I implemented the Touch controller bindings in my branch, do you want me to make a "clean branch" with just that in it and PR it?

Would this be useful to anyone? IMO a complete "hello world" XR app should show and use VR motion controllers, not just display a rotating cube. Like hello_xr. I haven't added any cubes to draw using the grip or aim pose or anything to the base samples (nor do I plan to), but at least having the bindings set up properly is good to have, right? I have bindings handy for all the other HMDs' controller types: HTC, Pico, Touch Pro controllers, and there are a bunch that are PC only.

image

The current XrApp update loop doesn't call XrSyncActions (in pollActions) so your framework won't support OOTB controllers or other events being polled at all, even if you add those bindings later. I'm not sure TBH if you can even add more bindings after the session is started.

image

If you actually want this PR I'll clean up my code and stuff it in another branch for a clean PR.

I also have Link Sharpening implemented which looks / works great (at least when using only 1 layer).

Doing this work made me realize that the current implementation of XrApp.h vs two XrApp.cpp has a TON of code reuse which is bad practice and results in duplicated work (see #94).

But I can't help but think that if IGL actually is to become useful to many people, the default main branch should have this stuff and generic code shouldn't be duplicated. I'd rather merge the controller bindings PR for just Touch controllers then you can refactor it after to remove duplicated parts that are common. There's no problem adding ex Vive or WMR bindings in a generic way on mobile, even though they are PC-only devices, because the runtime simply picks the best interaction profile to use at runtime. This is how hello_xr works, of course.

OpenXR SDK Source code is almost entirely generic between PC and mobile builds, the main differences are just in the initialization structs, extensions, and of course in their renderer / platform classes. But those are abstracted away (for better or worse, I needed ability to poll the Xr statuses from another thread for async / higher Hz polling rates used for CloudXR, so I made pollActions public and take an argument specifying which thread it's being called from, main or async thread. It could be enabled in both, as those booleans are independent in my code. Use case: when I connect to CloudXR and the async polling starts of controller states, I don't need the local poses updated so I flip that boolean. However, instead of using an enum to pick which, when I enable a locally drawn UI on top of the video stream, I will need both threads to poll their own states, and thus a separate copy of the states for each one. I've implemented this before and this is the only way to avoid dropped button transition events when one thread is polling at say 240 Hz and the main thread at 90 Hz, synchronous to the refresh rate).

@BattleAxeVR
Copy link
Contributor Author

BattleAxeVR commented Mar 19, 2024

(and yes, for anyone looking at the code I wrote closely, on Oculus Touch you do apparently have to use /value instead of /click for trigger boolean click events, it just treats the float as a bool)

This is NOT a bug, I double checked it last night, triggers and grips don't support the /click XrPath on Quest:

image

@corporateshark
Copy link
Contributor

a complete "hello world" XR app should show and use VR motion controllers, not just display a rotating cube

Absolutely!

@corporateshark corporateshark added the enhancement New feature or request label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants