Interface VRDisplay
Hierarchy
- EventTarget
- VRDisplay
Index
Properties
Readonly capabilitiesSearch playground for capabilities
depth FarSearch playground for depthFar
z-depth defining the far plane of the eye view frustum enables mapping of values in the render target depth attachment to scene coordinates. Initially set to 10000.0.
depth NearSearch playground for depthNear
z-depth defining the near plane of the eye view frustum enables mapping of values in the render target depth attachment to scene coordinates. Initially set to 0.01.
Readonly display IdSearch playground for displayId
An identifier for this distinct VRDisplay. Used as an association point in the Gamepad API.
Readonly display NameSearch playground for displayName
A display name, a user-readable name identifying it.
Readonly is ConnectedSearch playground for isConnected
Readonly is PresentingSearch playground for isPresenting
Readonly stage ParametersSearch playground for stageParameters
If this VRDisplay supports room-scale experiences, the optional stage attribute contains details on the room-scale parameters.
Methods
cancel Animation FrameSearch playground for cancelAnimationFrame
Passing the value returned by
requestAnimationFrame
tocancelAnimationFrame
will unregister the callback.Parameters
handle: number
Define the handle of the request to cancel
Returns void
exit PresentSearch playground for exitPresent
Stops presenting to the VRDisplay.
Returns Promise<void>
a promise to know when it stopped
get Eye ParametersSearch playground for getEyeParameters
Return the current VREyeParameters for the given eye.
Parameters
whichEye: string
Define the eye we want the parameter for
Returns VREyeParameters
the eye parameters
get Frame DataSearch playground for getFrameData
Populates the passed VRFrameData with the information required to render the current frame.
Parameters
frameData: VRFrameData
Define the data structure to populate
Returns boolean
true if ok otherwise false
get Immediate PoseSearch playground for getImmediatePose
Return the current instantaneous pose of the VRDisplay, with no prediction applied.
Returns VRPose
the current instantaneous pose
get LayersSearch playground for getLayers
Get the layers currently being presented.
Returns VRLayer[]
the list of VR layers
get PoseSearch playground for getPose
Return a VRPose containing the future predicted pose of the VRDisplay when the current frame will be presented. The value returned will not change until JavaScript has returned control to the browser.
The VRPose will contain the position, orientation, velocity, and acceleration of each of these properties.
Returns VRPose
the pose object
request Animation FrameSearch playground for requestAnimationFrame
The callback passed to
requestAnimationFrame
will be called any time a new frame should be rendered. When the VRDisplay is presenting the callback will be called at the native refresh rate of the HMD. When not presenting this function acts identically to how window.requestAnimationFrame acts. Content should make no assumptions of frame rate or vsync behavior as the HMD runs asynchronously from other displays and at differing refresh rates.Parameters
callback: FrameRequestCallback
Define the action to run next frame
Returns number
the request handle it
request PresentSearch playground for requestPresent
Begin presenting to the VRDisplay. Must be called in response to a user gesture. Repeat calls while already presenting will update the VRLayers being displayed.
Parameters
layers: VRLayer[]
Define the list of layer to present
Returns Promise<void>
a promise to know when the request has been fulfilled
reset PoseSearch playground for resetPose
Reset the pose for this display, treating its current position and orientation as the "origin/zero" values. VRPose.position, VRPose.orientation, and VRStageParameters.sittingToStandingTransform may be updated when calling resetPose(). This should be called in only sitting-space experiences.
Returns void
submit FrameSearch playground for submitFrame
The VRLayer provided to the VRDisplay will be captured and presented in the HMD. Calling this function has the same effect on the source canvas as any other operation that uses its source image, and canvases created without preserveDrawingBuffer set to true will be cleared.
Parameters
Optional pose: VRPose
Define the pose to submit
Returns void
Dictionary of capabilities describing the VRDisplay.