immersive-web / webxr-polyfill

Use the WebXR Device API today, providing fallbacks to native WebVR 1.1 and Cardboard
Apache License 2.0
381 stars 84 forks source link

Updated Gamepad mapping to check displayName #72

Closed toji closed 5 years ago

toji commented 5 years ago

This allows a different set of profiles to be exposed based on the displayName even if the gamepad.id matches. The primary example of this is Oculus Quest, where the controller identifies as an Oculus Touch and the mapping is identical, but the mesh should be different than the one used by an Oculus Rift.

Also added the ability to invert axes during mapping if needed. This has proven to be necessary with some WebVR devices.

Addresses https://github.com/immersive-web/webxr-input-profiles/issues/44, and enables similar mapping in the future with APIs like OpenVR (which I need to do some hands-on testing with prior to mapping.)