From 885a8e27853a7a4b5a546d2a820a1ac940cff30d Mon Sep 17 00:00:00 2001 From: Mikhail Pozdnyakov Date: Tue, 6 Feb 2018 15:29:26 +0200 Subject: [PATCH] Gyroscope can use the screen local coordinates The `SpatialSensorOptions` dictionary and the "construct spatial sensor object" are used, so that the client can set the local coordinate system for a Gyroscope instance from the constructor. This patch is a part of fix for https://github.com/w3c/sensors/issues/257 --- index.bs | 26 ++++++++++++++------ index.html | 69 ++++++++++++++++++++++++++++++------------------------ 2 files changed, 58 insertions(+), 37 deletions(-) diff --git a/index.bs b/index.bs index 7fa408b..7159471 100644 --- a/index.bs +++ b/index.bs @@ -29,8 +29,15 @@ urlPrefix: https://w3c.github.io/sensors; spec: GENERIC-SENSOR text: sensor text: latest reading text: default sensor - text: construct a sensor object; url: construct-sensor-object text: sensor type + text: local coordinate system +urlPrefix: https://w3c.github.io/accelerometer; spec: ACCELEROMETER + type: dfn + text: device coordinate system + text: screen coordinate system + text: construct spatial sensor object + type: interface + text: SpatialSensorOptions; url: dictdef-spatialsensoroptions Introduction {#intro} @@ -92,12 +99,17 @@ it must be according to the right-hand convention in a [=local coordinate system defined by the device, such that positive rotation around an axis is clockwise when viewed along the positive direction of the axis (see figure below). -Note: The local coordinate system of a mobile device is usually defined relative to -the device's screen when the device in its default orientation (see figure below). - Device's local coordinate system and rotation. +Reference Frame {#reference-frame} +---------------- + +The reference frame for {{Gyroscope}} is defined with +a [=local coordinate system=], which can be defined as +either the [=device coordinate system=], or the +[=screen coordinate system=]. + API {#api} === @@ -105,7 +117,7 @@ The Gyroscope Interface {#gyroscope-interface} --------------------------------
-  [Constructor(optional SensorOptions sensorOptions), SecureContext, Exposed=Window]
+  [Constructor(optional SpatialSensorOptions sensorOptions), SecureContext, Exposed=Window]
   interface Gyroscope : Sensor {
     readonly attribute double? x;
     readonly attribute double? y;
@@ -113,8 +125,8 @@ The Gyroscope Interface {#gyroscope-interface}
   };
 
-To Construct a Gyroscope Object the user agent must invoke the -construct a Sensor object abstract operation. +To Construct a Gyroscope Object the user agent must invoke +the [=construct spatial sensor object=] abstract operation. ### Gyroscope.x ### {#gyroscope-x} diff --git a/index.html b/index.html index 6540510..b3ae987 100644 --- a/index.html +++ b/index.html @@ -1183,9 +1183,8 @@ background-attachment: fixed; } - + -