VRStageParameters
Experimental: Это экспериментальная технология
Так как спецификация этой технологии ещё не стабилизировалась, смотрите таблицу совместимости по поводу использования в различных браузерах. Также заметьте, что синтаксис и поведение экспериментальной технологии может измениться в будущих версиях браузеров, вслед за изменениями спецификации.
The VRStageParameters
interface of the WebVR API represents the values describing the the stage area for devices that support room-scale experiences.
This interface is accessible through the VRDisplay.stageParameters
(en-US) property.
Properties
VRStageParameters.sittingToStandingTransform
Только для чтения-
Contains a matrix that transforms the sitting-space view matrices of
VRFrameData
to standing-space. VRStageParameters.sizeX
Только для чтения-
Returns the width of the play-area bounds in meters.
VRStageParameters.sizeY
Только для чтения-
Returns the depth of the play-area bounds in meters.
Examples
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
}
});
Specifications
Specification | Status | Comment |
---|---|---|
WebVR 1.1 Определение 'VRStageParameters' в этой спецификации. |
Черновик | Initial definition |
Browser compatibility
BCD tables only load in the browser
See also
- WebVR API homepage
- MozVr.com — demos, downloads, and other resources from the Mozilla VR team.