OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta charset=utf-8> | 4 <meta charset=utf-8> |
5 <title>WebVR IDL test</title> | 5 <title>WebVR IDL test</title> |
6 <link rel="help" href="https://w3c.github.io/webvr/"> | 6 <link rel="help" href="https://w3c.github.io/webvr/"> |
7 | 7 |
8 <script src=/resources/testharness.js></script> | 8 <script src=/resources/testharness.js></script> |
9 <script src=/resources/testharnessreport.js></script> | 9 <script src=/resources/testharnessreport.js></script> |
10 <script src=/resources/WebIDLParser.js></script> | 10 <script src=/resources/WebIDLParser.js></script> |
11 <script src=/resources/idlharness.js></script> | 11 <script src=/resources/idlharness.js></script> |
12 <script id="webvr_idl" type=text/plain> | 12 <script id="webvr_idl" type=text/plain> |
13 // Archived version of the WebVR spec from | 13 // Archived version of the WebVR spec from |
14 // https://w3c.github.io/webvr/archive/prerelease/1.1/index.html | 14 // https://w3c.github.io/webvr/archive/prerelease/1.1/index.html |
15 | 15 |
16 interface VRDisplay : EventTarget { | 16 interface VRDisplay : EventTarget { |
17 readonly attribute boolean isConnected; | |
18 readonly attribute boolean isPresenting; | 17 readonly attribute boolean isPresenting; |
19 | 18 |
20 /** | 19 /** |
21 * Dictionary of capabilities describing the VRDisplay. | 20 * Dictionary of capabilities describing the VRDisplay. |
22 */ | 21 */ |
23 [SameObject] readonly attribute VRDisplayCapabilities capabilities; | 22 [SameObject] readonly attribute VRDisplayCapabilities capabilities; |
24 | 23 |
25 /** | 24 /** |
26 * If this VRDisplay supports room-scale experiences, the optional | 25 * If this VRDisplay supports room-scale experiences, the optional |
27 * stage attribute contains details on the room-scale parameters. | 26 * stage attribute contains details on the room-scale parameters. |
(...skipping 21 matching lines...) Expand all Loading... |
49 */ | 48 */ |
50 readonly attribute DOMString displayName; | 49 readonly attribute DOMString displayName; |
51 | 50 |
52 /** | 51 /** |
53 * Populates the passed VRFrameData with the information required to render | 52 * Populates the passed VRFrameData with the information required to render |
54 * the current frame. | 53 * the current frame. |
55 */ | 54 */ |
56 boolean getFrameData(VRFrameData frameData); | 55 boolean getFrameData(VRFrameData frameData); |
57 | 56 |
58 /** | 57 /** |
59 * Return a VRPose containing the future predicted pose of the VRDisplay | |
60 * when the current frame will be presented. The value returned will not | |
61 * change until JavaScript has returned control to the browser. | |
62 * | |
63 * The VRPose will contain the position, orientation, velocity, | |
64 * and acceleration of each of these properties. | |
65 */ | |
66 [NewObject] VRPose getPose(); | |
67 | |
68 /** | |
69 * Reset the pose for this display, treating its current position and | |
70 * orientation as the "origin/zero" values. VRPose.position, | |
71 * VRPose.orientation, and VRStageParameters.sittingToStandingTransform may be | |
72 * updated when calling resetPose(). This should be called in only | |
73 * sitting-space experiences. | |
74 */ | |
75 void resetPose(); | |
76 | |
77 /** | |
78 * z-depth defining the near plane of the eye view frustum | 58 * z-depth defining the near plane of the eye view frustum |
79 * enables mapping of values in the render target depth | 59 * enables mapping of values in the render target depth |
80 * attachment to scene coordinates. Initially set to 0.01. | 60 * attachment to scene coordinates. Initially set to 0.01. |
81 */ | 61 */ |
82 attribute double depthNear; | 62 attribute double depthNear; |
83 | 63 |
84 /** | 64 /** |
85 * z-depth defining the far plane of the eye view frustum | 65 * z-depth defining the far plane of the eye view frustum |
86 * enables mapping of values in the render target depth | 66 * enables mapping of values in the render target depth |
87 * attachment to scene coordinates. Initially set to 10000.0. | 67 * attachment to scene coordinates. Initially set to 10000.0. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 117 |
138 dictionary VRLayer { | 118 dictionary VRLayer { |
139 VRSource? source = null; | 119 VRSource? source = null; |
140 | 120 |
141 sequence<float> leftBounds = []; | 121 sequence<float> leftBounds = []; |
142 sequence<float> rightBounds = []; | 122 sequence<float> rightBounds = []; |
143 }; | 123 }; |
144 | 124 |
145 interface VRDisplayCapabilities { | 125 interface VRDisplayCapabilities { |
146 readonly attribute boolean hasPosition; | 126 readonly attribute boolean hasPosition; |
147 readonly attribute boolean hasOrientation; | |
148 readonly attribute boolean hasExternalDisplay; | 127 readonly attribute boolean hasExternalDisplay; |
149 readonly attribute boolean canPresent; | 128 readonly attribute boolean canPresent; |
150 readonly attribute unsigned long maxLayers; | 129 readonly attribute unsigned long maxLayers; |
151 }; | 130 }; |
152 | 131 |
153 enum VREye { | 132 enum VREye { |
154 "left", | 133 "left", |
155 "right" | 134 "right" |
156 }; | 135 }; |
157 | 136 |
158 interface VRFieldOfView { | |
159 readonly attribute double upDegrees; | |
160 readonly attribute double rightDegrees; | |
161 readonly attribute double downDegrees; | |
162 readonly attribute double leftDegrees; | |
163 }; | |
164 | |
165 interface VRPose { | 137 interface VRPose { |
166 readonly attribute Float32Array? position; | 138 readonly attribute Float32Array? position; |
167 readonly attribute Float32Array? linearVelocity; | 139 readonly attribute Float32Array? linearVelocity; |
168 readonly attribute Float32Array? linearAcceleration; | 140 readonly attribute Float32Array? linearAcceleration; |
169 | 141 |
170 readonly attribute Float32Array? orientation; | 142 readonly attribute Float32Array? orientation; |
171 readonly attribute Float32Array? angularVelocity; | 143 readonly attribute Float32Array? angularVelocity; |
172 readonly attribute Float32Array? angularAcceleration; | 144 readonly attribute Float32Array? angularAcceleration; |
173 }; | 145 }; |
174 | 146 |
175 [Constructor] | 147 [Constructor] |
176 interface VRFrameData { | 148 interface VRFrameData { |
177 readonly attribute Float32Array leftProjectionMatrix; | 149 readonly attribute Float32Array leftProjectionMatrix; |
178 readonly attribute Float32Array leftViewMatrix; | 150 readonly attribute Float32Array leftViewMatrix; |
179 | 151 |
180 readonly attribute Float32Array rightProjectionMatrix; | 152 readonly attribute Float32Array rightProjectionMatrix; |
181 readonly attribute Float32Array rightViewMatrix; | 153 readonly attribute Float32Array rightViewMatrix; |
182 | 154 |
183 readonly attribute VRPose pose; | 155 readonly attribute VRPose pose; |
184 }; | 156 }; |
185 | 157 |
186 interface VREyeParameters { | 158 interface VREyeParameters { |
187 readonly attribute Float32Array offset; | 159 readonly attribute Float32Array offset; |
188 | 160 |
189 [SameObject] readonly attribute VRFieldOfView fieldOfView; | |
190 | |
191 readonly attribute unsigned long renderWidth; | 161 readonly attribute unsigned long renderWidth; |
192 readonly attribute unsigned long renderHeight; | 162 readonly attribute unsigned long renderHeight; |
193 }; | 163 }; |
194 | 164 |
195 interface VRStageParameters { | 165 interface VRStageParameters { |
196 readonly attribute Float32Array sittingToStandingTransform; | 166 readonly attribute Float32Array sittingToStandingTransform; |
197 | 167 |
198 readonly attribute float sizeX; | 168 readonly attribute float sizeX; |
199 readonly attribute float sizeZ; | 169 readonly attribute float sizeZ; |
200 }; | 170 }; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 idl_array.add_untested_idls("interface Gamepad {};"); | 231 idl_array.add_untested_idls("interface Gamepad {};"); |
262 | 232 |
263 idl_array.add_idls(document.getElementById("webvr_idl").textContent); | 233 idl_array.add_idls(document.getElementById("webvr_idl").textContent); |
264 | 234 |
265 idl_array.test(); | 235 idl_array.test(); |
266 done(); | 236 done(); |
267 }, {explicit_done: true}); | 237 }, {explicit_done: true}); |
268 </script> | 238 </script> |
269 </body> | 239 </body> |
270 </html> | 240 </html> |
OLD | NEW |