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

OpenXR: Support a wider array of interaction profiles and inputs #227

Closed
msub2 opened this issue Jul 21, 2024 · 5 comments
Closed

OpenXR: Support a wider array of interaction profiles and inputs #227

msub2 opened this issue Jul 21, 2024 · 5 comments

Comments

@msub2
Copy link
Contributor

msub2 commented Jul 21, 2024

Currently the OpenXR backend only supports a base set of inputs (pose, select, squeeze, hand input) and only two interaction profiles (microsoft motion controller and khr simple controller). While this is technically enough to implement support for the WebXR Gamepads Module in Servo, it should probably be expanded to include:

  • Thumbsticks/touchpads
  • Primary/secondary buttons (A/X, B/Y)
  • (Optionally) A trusted button for system interactions (either /input/menu or /input/system if available).
    • This isn't necessarily required for the WebXR Gamepads Module but it would be useful to have for potential future work on navigation/permission prompts while in an immersive session.

For interaction profiles I think covering a subset of the most-used headsets would be a good start (Meta/HTC/Pico/WMR), though it shouldn't be too hard to add more if necessary. The input profile name array will also need to be set properly, as it currently just returns "generic-hand" no matter what.

@msub2
Copy link
Contributor Author

msub2 commented Jul 24, 2024

PR for interaction profiles at #229, this is probably the one change that won't require a concurrent update in Servo as well.

@msub2
Copy link
Contributor Author

msub2 commented Jul 26, 2024

Passing data for buttons and axes will require some more significant changes to the API. Spots that will need changing:

  • mod.rs: Updating begin_animation_frame to pass along button/axes state
  • event.rs: Will likely need a new event to signal that gamepad input needs to be updated. Should probably cache input state to make sure the event only fires when input has actually changed
  • input.rs: Will need to update the logic in get_bindings to iterate through all the mappings present in the interaction profiles. Need to figure out how the data will be stored.

@msub2
Copy link
Contributor Author

msub2 commented Aug 6, 2024

With WebXR Gamepads Module support done, the last major item I'd consider part of this would be hand interaction profiles (trusted/system buttons can be revisited if/when they become necessary). I'll be doing some work to get Servo's WebXR Hand Input implementation up to date, after which interaction profiles for hand tracking can then be added without much extra effort.

@msub2
Copy link
Contributor Author

msub2 commented Aug 7, 2024

Hmm, looks like there's a little more to be done here before hand input will work. From what I can tell it looks like the Hand object is never getting created because it's trying to get state from OpenXR actions that don't exist. I'll probably need to create some new hand-specific interaction profiles

@msub2
Copy link
Contributor Author

msub2 commented Aug 12, 2024

Closing this now that PR for hand input update is pending and #236 has merged

@msub2 msub2 closed this as completed Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant