VrApi

VrApi

interface VrApi

Offers VR-related functionality. Accessible through Player.vr

Properties

NameSummary
gyroscopicOrientationProviderabstract var gyroscopicOrientationProvider: OrientationProvider?
The gyroscopic OrientationProvider that is used for VR control.
isGyroscopeEnabledabstract var isGyroscopeEnabled: Boolean
Specifies whether the gyroscope of the device is enabled.
isStereoabstract var isStereo: Boolean
Specifies whether stereo mode is enabled.
isTouchControlEnabledabstract var isTouchControlEnabled: Boolean
Specifies whether the touch controls of the device are enabled.
touchOrientationProviderabstract var touchOrientationProvider: OrientationProvider?
The touch OrientationProvider that is used for VR control.
viewingDirectionabstract var viewingDirection: ViewingDirection?
The current viewing direction.
viewingDirectionChangeEventIntervalabstract var viewingDirectionChangeEventInterval: Double
The minimal interval between consecutive VrViewingDirectionChanges. The default value is 250ms.
viewingDirectionChangeThresholdabstract var viewingDirectionChangeThreshold: Double
The number of degrees that the viewport can change before the VrViewingDirectionChange is triggered. The default value is 5°.

Functions

NameSummary
moveViewingDirectionabstract fun moveViewingDirection(direction: Vector3)
Moves the current VR viewing direction in the given direction with the given speed by passing a three-component Vector3. 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.
setVrRendererabstract fun setVrRenderer(renderer: VrRenderer?)
Sets the VrRenderer that is used to modify VR properties.