Igalia / wolvic

A fast and secure browser for standalone virtual-reality and augmented-reality headsets.
https://wolvic.org
Mozilla Public License 2.0
796 stars 100 forks source link

[OpenXR] Add support for hand interaction profile #1440

Closed svillar closed 3 months ago

svillar commented 3 months ago

OpenXR defines the XR_EXT_hand_interaction extension that allows users of the API to handle the input from hands as if they were physical controllers.

The hand tracking extensions we have been using so far, were completely disconnected to the OpenXR input model based on actions and input profiles. Hand gestures did not trigger events that can be handled using the OpenXR input model. That's why we had to use vendor specific extensions to compute aim or detect pinches or special system actions. For those systems not providing those we were inferring them from the position of the hand joints.

However with the hand interaction extension we can use the same input model based on actions and suggest bindings for certain paths provided by that extension. Those paths include poses (aim, grip, poke...) and also actions (pinch, grip...).

Apart from adding the input profiles we had to slightly modify the current code so that it does not assume that all the events coming from actions are from physical controllers. Likewise we should also retrieve hand joint information not only if there is no physical controller, but also if the system is using the hand interaction profile.