immersive-web / cardboard-vr-display

A JavaScript implementation of a WebVR 1.1 VRDisplay
https://immersive-web.github.io/cardboard-vr-display
Apache License 2.0
91 stars 43 forks source link

Use `referenceFrame` when Sensor API used #17

Closed jsantell closed 5 years ago

jsantell commented 6 years ago

via @pozdnyakov https://github.com/immersive-web/cardboard-vr-display/issues/10#issuecomment-366722664

@cvan @jsantell FYI, screen coordinates synchronization for the Accelerometer, Gyroscope, LinearAcceleration, AbsoluteOrientationSensor and RelativeOrientationSensor classes is available now in Chrome canaries (starting from 66.0.3350.0). In practice, it means that if you create a sensor object passing {referenceFrame:"screen"} to the constructor (e.g. new RelativeOrientationSensor({frequency: 60, referenceFrame:"screen"})) the screen coordinate system will be used to resolve the sensor readings. So, there will be no need to remap sensor readings on JS side when the screen orientation changes.

jsantell commented 6 years ago
cvan commented 6 years ago

just FYI: as of a week ago, in Chrome the Sensor API is now enabled by default (without needing to flip a flag)