Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface PlayerVRAPI

Hierarchy

  • PlayerVRAPI

Index

Methods

disableGyroscope

  • disableGyroscope(): boolean
  • Disables the gyroscope (also on VRHMDs).

    Returns boolean

    • True, if the VRHandler is ready, false otherwise.

disableKeyboardControl

  • disableKeyboardControl(): boolean
  • Disables the keyboard controls.

    Returns boolean

    • True, if the VRHandler is ready, false otherwise.

disableMouseControl

  • disableMouseControl(): boolean
  • Disables the mouse controls.

    Returns boolean

    • True, if the VRHandler is ready, false otherwise.

enableGyroscope

  • enableGyroscope(): boolean
  • Enables the gyroscope (also on VRHMDs).

    Returns boolean

    • True, if the VRHandler is ready, false otherwise.

enableKeyboardControl

  • enableKeyboardControl(): boolean
  • Enables the keyboard controls.

    Returns boolean

    • True, if the VRHandler is ready, false otherwise.

enableMouseControl

  • enableMouseControl(): boolean
  • Enables the mouse controls.

    Returns boolean

    • True, if the VRHandler is ready, false otherwise.

getHorizontalFieldOfView

  • getHorizontalFieldOfView(): number
  • Gets the horizontal field of view in degrees.

    Returns number

    • The horizontal field of view in degrees.

getLastError

  • getLastError(): string | null
  • Returns the last recorded error or null, if no error occurred.

    Returns string | null

    • The last recorded error.

getState

  • getState(): string | null
  • Returns the current state of the VR handler or null, if the VR handler is not yet initialized.

    Returns string | null

    • The current state of the VR handler.

getStereo

  • getStereo(): boolean
  • Returns true, if stereo is enabled, false otherwise.

    Returns boolean

    • True, if stereo is enabled, false otherwise.

getVerticalFieldOfView

  • getVerticalFieldOfView(): number
  • Gets the vertical field of view in degrees.

    Returns number

    • The vertical field of view in degrees.

getViewingDirection

  • Returns the current viewing direction, if the VRHandler is in the playing state.

    Returns ViewingDirection

    • The current viewing direction.

getViewingDirectionChangeEventInterval

  • getViewingDirectionChangeEventInterval(): number
  • Gets the minimal interval between consecutive ON_VR_VIEWING_DIRECTION_CHANGE events.

    Returns number

    • The minimal interval between consecutive ON_VR_VIEWING_DIRECTION_CHANGE events.

getViewingDirectionChangeThreshold

  • getViewingDirectionChangeThreshold(): number
  • Gets the number of degrees that the viewport can change before the ON_VR_VIEWING_DIRECTION_CHANGE event is triggered.

    Returns number

    • The threshold in degrees that the viewport can change before the ON_VR_VIEWING_DIRECTION_CHANGE event is triggered.

getZoom

  • getZoom(): number
  • Returns the current zoom factor.

    Returns number

    • The current zoom factor, if the VRHandler is ready, -1 otherwise.

isGyroscopeEnabled

  • isGyroscopeEnabled(): boolean
  • Returns true, if the gyroscope is enabled, false otherwise.

    Returns boolean

    • True, if the gyroscope is enabled, false otherwise.

isKeyboardControlEnabled

  • isKeyboardControlEnabled(): boolean
  • Returns true, if keyboard controls are enabled, false otherwise.

    Returns boolean

    • True, if keyboard controls are enabled, false otherwise.

isMouseControlEnabled

  • isMouseControlEnabled(): boolean
  • Returns true, if mouse controls are enabled, false otherwise.

    Returns boolean

    • True, if mouse controls are enabled, false otherwise.

moveViewingDirection

  • moveViewingDirection(direction: Vec3): boolean
  • Moves the current VR viewing direction in the given direction with the given speed. The speed is determined by the length of the direction vector in degrees / second. The movement will be continued for 110ms, after that period the movement will be dampened and fade out. To sustain a smooth viewport movement, no more than 100ms must pass between consecutive calls to this function.

    Parameters

    • direction: Vec3

      A three-component vector describing the direction and speed in which the viewing direction shall be moved.

    Returns boolean

    • True, if the VRHandler is ready, false otherwise.

setHorizontalFieldOfView

  • setHorizontalFieldOfView(fieldOfView: number): boolean
  • Sets the horizontal field of view in degrees.

    Parameters

    • fieldOfView: number

      The horizontal field of view in degrees.

    Returns boolean

    • True, if the VRHandler is ready, false otherwise.

setStereo

  • setStereo(enableStereo: boolean): boolean
  • Enables or disables stereo mode for VR content.

    Parameters

    • enableStereo: boolean

      If true, stereo mode will be enabled.

    Returns boolean

    • True if API call was successful, false otherwise.

setVerticalFieldOfView

  • setVerticalFieldOfView(fieldOfView: number): boolean
  • Sets the vertical field of view in degrees.

    Parameters

    • fieldOfView: number

      The vertical field of view in degrees.

    Returns boolean

    • True, if the VRHandler is ready, false otherwise.

setViewingDirection

  • Sets the given viewing direction, if the VRHandler is in the playing state.

    Parameters

    Returns boolean

    • True, if the viewing direction could be set, false otherwise.

setViewingDirectionChangeEventInterval

  • setViewingDirectionChangeEventInterval(interval: number): boolean
  • Sets the minimal interval between consecutive ON_VR_VIEWING_DIRECTION_CHANGE events. The default value is 250ms.

    Parameters

    • interval: number

      The minimal interval between consecutive ON_VR_VIEWING_DIRECTION_CHANGE events.

    Returns boolean

    • True, if the VRHandler is ready, false otherwise.

setViewingDirectionChangeThreshold

  • setViewingDirectionChangeThreshold(threshold: number): boolean
  • Sets the number of degrees that the viewport can change before the ON_VR_VIEWING_DIRECTION_CHANGE event is triggered. The default value is 5°.

    Parameters

    • threshold: number

      The threshold in degrees that the viewport can change before the ON_VR_VIEWING_DIRECTION_CHANGE event is triggered.

    Returns boolean

    • True, if the VRHandler is ready, false otherwise.

zoom

  • zoom(factor: number): boolean
  • Applies a zoom factor to the current field of view.

    Parameters

    • factor: number

      The zoom factor to apply.

    Returns boolean

    • True, if the VRHandler is ready, false otherwise.

Generated using TypeDoc