Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • EventTarget
    • VRDisplay

Index

Properties

capabilities: VRDisplayCapabilities

Dictionary of capabilities describing the VRDisplay.

depthFar: number

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.

depthNear: number

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.

displayId: number

An identifier for this distinct VRDisplay. Used as an association point in the Gamepad API.

displayName: string

A display name, a user-readable name identifying it.

isConnected: boolean
isPresenting: boolean
stageParameters: null | VRStageParameters

If this VRDisplay supports room-scale experiences, the optional stage attribute contains details on the room-scale parameters.

Methods

  • cancelAnimationFrame(handle: number): void
  • Passing the value returned by requestAnimationFrame to cancelAnimationFrame will unregister the callback.

    Parameters

    • handle: number

      Define the handle of the request to cancel

    Returns void

  • exitPresent(): Promise<void>
  • Stops presenting to the VRDisplay.

    Returns Promise<void>

    a promise to know when it stopped

  • Return the current VREyeParameters for the given eye.

    Parameters

    • whichEye: string

      Define the eye we want the parameter for

    Returns VREyeParameters

    the eye parameters

  • 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

  • Return the current instantaneous pose of the VRDisplay, with no prediction applied.

    Returns VRPose

    the current instantaneous pose

  • Get the layers currently being presented.

    Returns VRLayer[]

    the list of VR layers

  • 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

  • requestAnimationFrame(callback: FrameRequestCallback): number
  • 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

  • requestPresent(layers: VRLayer[]): Promise<void>
  • 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

  • resetPose(): void
  • 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

  • submitFrame(pose?: VRPose): void
  • 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

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme