W3C home > Mailing lists > Public > public-device-apis-log@w3.org > March 2017

Re: [sensors] Provide the DeviceOrientation sensor

From: Alexander Shalamov via GitHub <sysbot+gh@w3.org>
Date: Wed, 01 Mar 2017 14:21:09 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-283352227-1488378067-sysbot+gh@w3.org>
For basic use-cases we can add predefined set of orientations 
@pozdnyakov wdyt?

```
enum Orientation {
 "Portrait",
 "PortraitFlipped",
 "Landscape",
 "LandscapeFlipped",
 ....
};

interface DeviceOrientation : Sensor {
   // 4x4 rotation matrix
   void populateRotationMatrix(Float32Array);

   // populates quaternion [cos(θ/2), x*sin(θ/2), y*sin(θ/2), 
z*sin(θ/2)]
   void populateQuaternion(Float32Array);

   // For basic use-cases
   readonly attribute Orientation orientation;
};
```

-- 
GitHub Notification of comment by alexshalamov
Please view or discuss this issue at 
https://github.com/w3c/sensors/issues/170#issuecomment-283352227 using
 your GitHub account
Received on Wednesday, 1 March 2017 14:21:18 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 12:18:52 UTC