/
VRDisplay.cljs
356 lines (241 loc) · 9.61 KB
/
VRDisplay.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
(ns web.media.VRDisplay
"The VRDisplay interface of the WebVR API represents any VR device
by this API. It includes generic information such as device IDs
descriptions, as well as methods for starting to present a VR
retrieving eye parameters and display capabilities, and other
functionality."
(:refer-clojure :exclude []))
(defn get-eye-parameters
"Method.
[Experimental]
The getEyeParameters() method of the `web.media.VRDisplay` interface
the `web.vr.VREyeParameters` object containing the eye parameters
the specified eye.
`var myEyeParameters = vrDisplayInstance.getEyeParameters(whichEye);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/getEyeParameters`"
[this which-eye]
(-> this (.getEyeParameters which-eye)))
(defn get-frame-data
"Method.
[Experimental]
The getFrameData() method of the `web.media.VRDisplay` interface
a `web.vr.VRFrameData` object and populates it with the information
to render the current frame.
`vrDisplayInstance.getFrameData(frameData);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/getFrameData`"
[this frame-data]
(-> this (.getFrameData frame-data)))
(defn get-layers
"Method.
[Experimental]
The getLayers() method of the `web.media.VRDisplay` interface
the layers currently being presented by the VRDisplay.
`var myLayers = vrDisplayInstance.getLayers();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/getLayers`"
[this ]
(-> this (.getLayers)))
(defn reset-pose
"Method.
[Deprecated]
The resetPose() method of the `web.media.VRDisplay` interface
the pose for the VRDisplay, treating its current `VRPose.position`
`VRPose.orientation` as the \\\"origin/zero\\\" values.
`vrDisplayInstance.resetPose();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/resetPose`"
[this ]
(-> this (.resetPose)))
(defn cancel-animation-frame
"Method.
[Experimental]
The cancelAnimationFrame() method of the `web.media.VRDisplay`
is a special implementation of `Window.cancelAnimationFrame`
unregisters callbacks registered with `VRDisplay.requestAnimationFrame()`.
`vrDisplayInstance.cancelAnimationFrame(handle);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/cancelAnimationFrame`"
[this handle]
(-> this (.cancelAnimationFrame handle)))
(defn request-animation-frame
"Method.
[Experimental]
The requestAnimationFrame() method of the `web.media.VRDisplay`
is a special implementation of `Window.requestAnimationFrame`
a callback function that will be called every time a new frame
the VRDisplay presentation is rendered:
`var handle = vrDisplayInstance.requestAnimationFrame(callback);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/requestAnimationFrame`"
[this callback]
(-> this (.requestAnimationFrame callback)))
(defn request-present
"Method.
[Experimental]
The requestPresent() method of the `web.media.VRDisplay` interface
the VRDisplay presenting a scene.
`vrDisplayInstance.requestPresent(layers).then(function() {
// Do something after the presentation has begun
});`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/requestPresent`"
[this & args]
(-> this .-requestPresent (.apply this (clj->js args))))
(defn exit-present
"Method.
[Experimental]
The exitPresent() method of the `web.media.VRDisplay` interface
the VRDisplay presenting a scene.
`vrDisplayInstance.exitPresent().then(function() {
// Do something after the presentation has ended
});`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/exitPresent`"
[this & args]
(-> this .-exitPresent (.apply this (clj->js args))))
(defn submit-frame
"Method.
[Experimental]
The submitFrame() method of the `web.media.VRDisplay` interface
the current state of the `web.vr.VRLayerInit` currently being
and displays it on the VRDisplay.
`vrDisplayInstance.submitFrame();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/submitFrame`"
[this ]
(-> this (.submitFrame)))
(defn get-pose
"Method.
[Deprecated]
The getPose() method of the `web.media.VRDisplay` interface returns
`web.vr.VRPose` object defining the future predicted pose of
VRDisplay as it will be when the current frame is actually presented.
`var myPose = vrDisplayInstance.getPose();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/getPose`"
[this ]
(-> this (.getPose)))
(defn get-immediate-pose
"Method.
[Experimental]
[Obsolute]
The getImmediatePose() method of the `web.media.VRDisplay` interface
a `web.vr.VRPose` object defining the current pose of the VRDisplay,
no prediction applied.
`var myImmediatePose = vrDisplayInstance.getImmediatePose();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/getImmediatePose`"
[this ]
(-> this (.getImmediatePose)))
(defn hardware-unit-id
"Method.
[Experimental]
[Obsolute]
The hardwareUnitId read-only property of the `VRDevice` interface
the distinct hardware ID for the overall hardware unit that this
is a part of. All devices that are part of the same physical
of hardware will have the same hardwareUnitId.
`var hardwareID = VRDevice.hardwareUnitId;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/hardwareUnitId`"
[this ]
(-> this (.hardwareUnitId)))
(defn capabilities
"Property.
[Read Only]
[Experimental]
The capabilities read-only property of the `web.media.VRDisplay`
returns a `web.vr.VRDisplayCapabilities` object that indicates
various capabilities of the VRDisplay.
`var myCapabilities = vrDisplayInstance.capabilities;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/capabilities`"
[this]
(-> this (.-capabilities)))
(defn depth-far
"Property.
[Experimental]
The depthFar property of the `web.media.VRDisplay` interface
and sets the z-depth defining the far plane of the eye view frustum,
the furthest viewable boundary of the scene.
`var mydepthFar = vrDisplayInstance.depthFar;
vrDisplayInstance.depthFar = 7500.0;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/depthFar`"
[this]
(-> this (.-depthFar)))
(defn set-depth-far!
"Property.
[Experimental]
The depthFar property of the `web.media.VRDisplay` interface
and sets the z-depth defining the far plane of the eye view frustum,
the furthest viewable boundary of the scene.
`var mydepthFar = vrDisplayInstance.depthFar;
vrDisplayInstance.depthFar = 7500.0;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/depthFar`"
[this val]
(aset this "depthFar" val))
(defn depth-near
"Property.
[Experimental]
The depthNear property of the `web.media.VRDisplay` interface
and sets the z-depth defining the near plane of the eye view
i.e. the nearest viewable boundary of the scene.
`var mydepthNear = vrDisplayInstance.depthNear;
vrDisplayInstance.depthNear = 1.0;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/depthNear`"
[this]
(-> this (.-depthNear)))
(defn set-depth-near!
"Property.
[Experimental]
The depthNear property of the `web.media.VRDisplay` interface
and sets the z-depth defining the near plane of the eye view
i.e. the nearest viewable boundary of the scene.
`var mydepthNear = vrDisplayInstance.depthNear;
vrDisplayInstance.depthNear = 1.0;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/depthNear`"
[this val]
(aset this "depthNear" val))
(defn display-id
"Property.
[Read Only]
[Experimental]
The displayId read-only property of the `web.media.VRDisplay`
returns an identifier for this particular VRDisplay, which is
used as an association point in the Gamepad API (see `Gamepad.displayId`).
`var myDisplayID = vrDisplayInstance.displayId;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/displayId`"
[this]
(-> this (.-displayId)))
(defn display-name
"Property.
[Read Only]
[Experimental]
The displayName read-only property of the `web.media.VRDisplay`
returns a human-readable name to identify the VRDisplay.
`var myDisplayName = vrDisplayInstance.displayName;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/displayName`"
[this]
(-> this (.-displayName)))
(defn is-connected
"Property.
[Read Only]
[Experimental]
The isConnected read-only property of the `web.media.VRDisplay`
returns a `js.Boolean` indicating whether the VRDisplay is connected
the computer.
`var isItConnected = vrDisplayInstance.isConnected;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/isConnected`"
[this]
(-> this (.-isConnected)))
(defn is-presenting
"Property.
[Read Only]
[Experimental]
The isPresenting read-only property of the `web.media.VRDisplay`
returns a `js.Boolean` indicating whether the VRDisplay is currently
content presented through it.
`var isItPresenting = vrDisplayInstance.isPresenting;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/isPresenting`"
[this]
(-> this (.-isPresenting)))
(defn stage-parameters
"Property.
[Read Only]
[Experimental]
The stageParameters read-only property of the `web.media.VRDisplay`
returns a `web.vr.VRStageParameters` object containing room-scale
if the VRDisplay is capable of supporting room-scale experiences.
`var myStageParameters = vrDisplayInstance.stageParameters;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/VRDisplay/stageParameters`"
[this]
(-> this (.-stageParameters)))