[w3c/gamepad] Added GamepadPose and GamepadCapabilities (#25)

This is my proposal for adding motion, orientation, and position tracking to the Gamepad spec. Seems like creating a pull request here may be a more productive way to fostering conversation around the feature than the mailing list, which was relatively quiet on the subject.

The new interfaces are closely modeled after the VRDisplayPose and VRDisplayCapabilities interfaces defined in the [WebVR spec](https://w3c.github.io/webvr/), and I expect that they will commonly be used in conjunction. I've already prototyped exposing the device pose like this in my [experimental WebVR builds](https://webvr.info/get-chrome) and the community has taken to it fairly enthusiastically:

http://elevr.com/drawing-in-webvr/
https://twitter.com/mrdoob/status/742582533561290752
https://twitter.com/fernandojsg/status/740685191581175810
https://twitter.com/fernandojsg/status/737356455737712642

Despite having it's origins in VR, however, I don't feel this features should explicitly be tied to the WebVR spec since it could benefit many more traditional gamepads as well. The Wii remote or PS4 controllers could provide accelerometer and orientation data, for example.

GamepadCapabilities is added here to make explicit wether or not a device can communicate position or orientation, since those values may not always be available continuously and it's important for developers to disambiguate between the hardware not having the capability at all (`capabilities.hasPosition = false`) or the device momentarily losing tracking because, say, a cat walked in front of an external sensor. (`pose.position = null`) There is no `hasPose` in the capabilities interface because that should be implied by the pose attribute being `null`.

Very happy to discuss this further and/or clean up the pull request to clarify things! Thanks!
You can view, comment on, or merge this pull request online at:

  https://github.com/w3c/gamepad/pull/25

-- Commit Summary --

  * Added GamepadPose and GamepadCapabilities

-- File Changes --

    M index.html (101)

-- Patch Links --

https://github.com/w3c/gamepad/pull/25.patch
https://github.com/w3c/gamepad/pull/25.diff

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/pull/25

Received on Wednesday, 15 June 2016 16:00:00 UTC