Closed Bug 1621369 Opened 4 years ago Closed 4 years ago

Mapping OpenVR/Oculus controllers to WebXR spec and giving conversion for WebVR

Categories

(Core :: WebVR, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: daoshengmu, Assigned: daoshengmu)

References

Details

Attachments

(4 files)

We currently follow button and axis order for WebVR. Due to the migration from WebVR to WebXR is happening, we wanna support WebXR controllers in more efficient ways. Therefore, we would support WebXR button/axis order by default in all VR sessions. Then, considering to do our conversation in VRDisplayClient::FireGamepadEvents (Because WebXR will be no longer to handle these Gamepad events.)

Blocks: 1609202

There are several goals for this bug.

  1. Refactoring OpenVR controller module. We have too much redundant code and most of them can use macro preprocessor to generate.
  2. Due to we need to convert WebXR btn/axis order to WebVR based on controller's id. To avoid inefficient strcmp(), we would have to store a ControllerType flag in VRShmem, so we would like to reuse OpenVRControllerType to be VRControllerType, and we can consider to remove this flag once we decide to remove WebVR support.
  3. Adjust Oculus controller btn/axis order to WebXR rules.
  4. Giving a convert function to map WebXR btn/axis order to WebVR. After digging it into a bit, I find VRDisplayClient::FireGamepadEvents() only will be called in WebVR because WebXR will not add gamepad objects into GamepadManager. Doing this conversion in Gamepadpad is possible, but we have to add variables in PGamepadEventChannel, like ControllerType, and general gampads don't need this variable actually.
Pushed by dmu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/17182dacd40f
Part 1: Refactor OpenVR controller and adjust its button/axis order for WebXR. r=kip
https://hg.mozilla.org/integration/autoland/rev/a7b839503f7a
Part 2: Replace OpenVRControllerType with VRControllerType in IPC. r=kip
https://hg.mozilla.org/integration/autoland/rev/2174a2a5ece7
Part 3: Adjust Oculus controller button/axis order for WebXR. r=kip
https://hg.mozilla.org/integration/autoland/rev/4e4156f53e24
Part 4: Support WebXR to WebVR gamepad button/axis re-mapping. r=kip
Regressions: 1624645
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: