Re: Generic Sensor API and Gamepad API?

 > > The Gamepad API (https://w3c.github.io/gamepad/) has proposed extensions (https://w3c.github.io/gamepad/extensions.html) purpose-built for WebVR use cases. Brandon has specced and implemented the extensions in Chromium (in the experimental Chromium WebVR build behind the enable-gamepad-extensions flag).
> > 
> > The GamepadPose interface (https://w3c.github.io/gamepad/extensions.html#gamepadpose-interface) in the extension spec is currently reusing the VRPose (https://w3c.github.io/webvr/#interface-vrpose) definitions from the WebVR API. The Float32Array type is used for position, linearVelocity, linearAcceleration et al. to make it a good fit for passing data to WebGL (same rationale as for the WebVR API).
> > 
> > In order to use the Generic Sensor API for Gamepad API, these attributes could instead expose an instance of Generic Sensor API-based Accelerometer (https://w3c.github.io/accelerometer/#accelerometer-interface) or Gyroscope (https://w3c.github.io/gyroscope/#gyroscope-interface). We could perhaps expose their sensor data also in Float32Array type in future versions of the specs given good use cases (making data passing to WebGL easier and more performant sounds like a good use case).
> 
> Related, Domenic had suggested using named properties such as x, y, z
> instead of Float32Arrays in the Gamepad API (extensions) for position (I
> assume comments apple equally to linearVelocity, linearAcceleration et
> al.:
> 
> https://github.com/w3c/gamepad/pull/25#issuecomment-235748277
> 
> Using the Generic Sensor API-based Accelerometer and Gyroscope for
> Gamepad API we'd get just that.
> 
> Brandon had a good response, and the rest of the discussion seemed
> relevant too.

Yeah, VRPose is the same thing as a SensorReading. It would be silly not
to converge.

If the Float32Arrays used in VRPose provide performance benefit, it's
something I'd like to see integrated in the motion sensor spec I want us
to move towards. This motion sensor spec would include low-level sensors
(gyroscope, accelerometer, magnetometer), but also higher level
constructs obtained by the fusion of the lower-level sensors, possibly
up to and including head-tracking.

Best,

--tobie

Received on Wednesday, 2 November 2016 14:38:37 UTC