VRDisplay
This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.
The VRDisplay
interface of the WebVR API represents any VR device supported by this API. It includes generic information such as device IDs and descriptions, as well as methods for starting to present a VR scene, retrieving eye parameters and display capabilities, and other important functionality.
An array of all connected VR Devices can be returned by invoking the Navigator.getVRDisplays()
method.
Properties
VRDisplay.capabilities
Read only- Returns a
VRDisplayCapabilities
object that indicates the various capabilities of theVRDisplay
. VRDisplay.depthFar
- Gets and sets the z-depth defining the far plane of the eye view frustum, i.e. the furthest viewable boundary of the scene.
VRDisplay.depthNear
- Gets and sets the z-depth defining the near plane of the eye view frustum, i.e. the nearest viewable boundary of the scene.
VRDisplay.displayId
Read only- Returns an identifier for this particular VRDisplay, which is also used as an association point in the Gamepad API (see
Gamepad.displayId
). VRDisplay.displayName
Read only- Returns a human-readable name to identify the
VRDisplay
. VRDisplay.isConnected
Read only- Returns a
Boolean
indicating whether theVRDisplay
is connected to the computer. VRDisplay.isPresenting
Read only- Returns a
Boolean
indicating whether theVRDisplay
is currently having content presented through it. VRDisplay.stageParameters
Read only- Returns a
VRStageParameters
object containing room-scale parameters, if theVRDisplay
is capable of supporting room-scale experiences.
Methods
VRDisplay.getEyeParameters()
- Returns the
VREyeParameters
object containing the eye parameters for the specified eye. VRDisplay.getLayers()
- Returns the layers currently being presented by the
VRDisplay
. VRDisplay.getPose()
- Returns a
VRPose
object defining the future predicted pose of theVRDisplay
as it will be when the current frame is actually presented. VRDisplay.getImmediatePose()
- Returns a
VRPose
object defining the current pose of theVRDisplay
, with no prediction applied. VRDisplay.resetPose()
- Resets the pose for this
VRDisplay
, treating its currentVRPose.position
andVRPose.orientation
as the "origin/zero" values. VRDisplay.cancelAnimationFrame()
- A special implementation of
Window.cancelAnimationFrame
that allows callbacks registered withVRDisplay.requestAnimationFrame()
to be unregistered. VRDisplay.requestAnimationFrame()
- A special implementation of
Window.requestAnimationFrame
containing a callback function that will be called every time a new frame of theVRDisplay
presentation is rendered. VRDisplay.requestPresent()
- Starts the
VRDisplay
presenting a scene. VRDisplay.exitPresent()
- Stops the
VRDisplay
presenting a scene. VRDisplay.submitFrame()
- Captures the current state of the
VRLayer
currently being presented and displays it on theVRDisplay
.
Examples
TBD.
Specifications
Specification | Status | Comment |
---|---|---|
WebVR The definition of 'VRDisplay' in that specification. |
Editor's Draft | Initial definition |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | No support | No support | No support |
Feature | Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|
Basic support | No support | (Yes) | No support | No support | No support | No support |
See also
- WebVR API homepage.
- MozVr.com — demos, downloads, and other resources from the Mozilla VR team.
License
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/vrdisplay