blob: 1eb4b73334e41fa536a584727c2debd4cd61eeb6 (
plain)
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
|
---
title: VRStageParameters
slug: Web/API/VRStageParameters
tags:
- API
- Experimental
- Interface
- NeedsTranslation
- Reference
- TopicStub
- VR
- VRStageParameters
- Virtual Reality
- WebVR
translation_of: Web/API/VRStageParameters
---
<div>{{APIRef("WebVR API")}}{{SeeCompatTable}}</div>
<p>The <strong><code>VRStageParameters</code></strong> interface of the <a href="/en-US/docs/Web/API/WebVR_API">WebVR API</a> represents the values describing the the stage area for devices that support room-scale experiences.</p>
<p>This interface is accessible through the {{domxref("VRDisplay.stageParameters")}} property.</p>
<h2 id="Properties">Properties</h2>
<dl>
<dt>{{domxref("VRStageParameters.sittingToStandingTransform")}} {{readonlyInline}}</dt>
<dd>Contains a matrix that transforms the sitting-space view matrices of {{domxref("VRFrameData")}} to standing-space.</dd>
<dt>{{domxref("VRStageParameters.sizeX")}} {{readonlyInline}}</dt>
<dd><dfn>Returns the w</dfn>idth of the play-area bounds in meters.</dd>
<dt>{{domxref("VRStageParameters.sizeY")}} {{readonlyInline}}</dt>
<dd><dfn>Returns the depth</dfn> of the play-area bounds in meters.</dd>
</dl>
<h2 id="Examples">Examples</h2>
<pre class="brush: js">var info = document.querySelector('p');
var vrDisplay;
navigator.getVRDisplays().then(function(displays) {
vrDisplay = displays[0];
var stageParams = vrDisplay.stageParameters;
// stageParams is a VRStageParameters object
if(stageParams === null) {
info.textContent = 'Your VR Hardware does not support room-scale experiences.'
} else {
info.innerHTML = '<strong>Display stage parameters</strong>'
+ '<br>Sitting to standing transform: ' + stageParams.sittingToStandingTransform
+ '<br>Play area width (m): ' + stageParams.sizeX
+ '<br>Play area depth (m): ' + stageParams.sizeY
}
});</pre>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('WebVR 1.1', '#interface-vrstageparameters', 'VRStageParameters')}}</td>
<td>{{Spec2('WebVR 1.1')}}</td>
<td>Initial definition</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat}}</p>
<h2 id="See_also">See also</h2>
<ul>
<li><a href="/en-US/docs/Web/API/WebVR_API">WebVR API homepage</a></li>
<li><a href="http://mozvr.com/">MozVr.com</a> — demos, downloads, and other resources from the Mozilla VR team.</li>
</ul>
|