VrApi

interface VrApi

Offers VR-related functionality. Accessible through Player.vr

Properties

Link copied to clipboard

The gyroscopic OrientationProvider that is used for VR control.

Link copied to clipboard

Specifies whether the gyroscope of the device is enabled.

Link copied to clipboard
abstract var isStereo: Boolean

Specifies whether stereo mode is enabled.

Link copied to clipboard

Specifies whether the touch controls of the device are enabled.

Link copied to clipboard

The touch OrientationProvider that is used for VR control.

Link copied to clipboard

The current viewing direction.

Link copied to clipboard

The minimal interval between consecutive VrViewingDirectionChanges. The default value is 250ms.

Link copied to clipboard

The number of degrees that the viewport can change before the VrViewingDirectionChange is triggered. The default value is 5°.

Functions

Link copied to clipboard
abstract 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.

Link copied to clipboard
abstract fun setVrRenderer(renderer: VrRenderer?)

Sets the VrRenderer that is used to modify VR properties.