- From: Mikhail Pozdnyakov via GitHub <sysbot+gh@w3.org>
- Date: Fri, 24 Feb 2017 14:43:01 +0000
- To: public-device-apis-log@w3.org
Here is an updated IDL with a better description
```
[Constructor(optional SensorOptions sensorOptions)]
interface DeviceOrientationSensor : Sensor {
/**
* Populates the passed 4-element array with the device orientation
data
* represented as a unit quaterninon:
* [cos(theta/2), Vx*sin(theta/2), Vy*sin(theta/2),
Vz*sin(theta/2)], where
* Vx, Vy, Vz a coordinates of a unit vector representing the axe
of rotation,
* and theta is the angle of rotation about the axe of rotation.
*
* The x,y, and z-axis are defined as following:
* x-axis points east
* y-axis points north
* z-axis points up and is perpendicular to the ground
*
*/
void getQuaternion(Float32Array quaternion);
/**
* Populates the passed 16-element array with the 4*4
WebGL-compatible
* rotation matrix, calculated from the contained quaternion.
*
* The given array is populated as shown below:
* [ matrix[0], matrix[1], matrix[ 2], 0,
* matrix[4], matrix[5], matrix[ 6], 0,
* matrix[8], matrix[9], matrix[10], 0,
* 0, 0, 0, 1]
*
*/
void getRotationMatrix(Float32Array matrix);
}
```
--
GitHub Notification of comment by pozdnyakov
Please view or discuss this issue at
https://github.com/w3c/sensors/issues/170#issuecomment-282307843 using
your GitHub account
Received on Friday, 24 February 2017 14:43:08 UTC