immersive-web / webxr-gamepads-module

Repository for the WebXR Gamepads Module
https://immersive-web.github.io/webxr-gamepads-module
Other
30 stars 11 forks source link

Reconsidering the rules for when XRInputSource.gamepad should be null #3

Closed NellWaliczek closed 5 years ago

NellWaliczek commented 5 years ago

The spec currently states:

If the XR input source does not have at least one of the following properties, the gamepad attribute MUST be null:

  • Multiple buttons
  • A button which reports analog values
  • An axis

I'd like to suggest we change the restrictions to be:

If the XR input source does not have at least one of the following properties, the gamepad attribute MUST be null:

  • A single button and a gripSpace
  • More than one button
  • One or more axes

This is for a few reasons:

  1. Technically, as written, a motion controller with two axes and no buttons would be prohibited even though a profile is defined for it: touchpad-thumbstick-controller.
  2. Rendering a motion controller button and axis movement is done by monitoring the axis and button values. By excluding motion controllers with only one non-analog button, we force developers to write special case code to render button movement by instead monitoring the select events.
  3. I believe this preserves the original intent of allowing a gamepad object to be returned for headset buttons/axes which are not otherwise available on an XRInputSource.
toji commented 5 years ago

Agreed.