VrApi

interface VrApi

Offers VR-related functionality. Accessible through Player.vr

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.

Properties

Link copied to clipboard
abstract var gyroscopicOrientationProvider: OrientationProvider?

The gyroscopic OrientationProvider that is used for VR control.

Link copied to clipboard
abstract var isGyroscopeEnabled: Boolean

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
abstract var isTouchControlEnabled: Boolean

Specifies whether the touch controls of the device are enabled.

Link copied to clipboard
abstract var touchOrientationProvider: OrientationProvider?

The touch OrientationProvider that is used for VR control.

Link copied to clipboard
abstract var viewingDirection: ViewingDirection?

The current viewing direction.

Link copied to clipboard
abstract var viewingDirectionChangeEventInterval: Double

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

Link copied to clipboard
abstract var viewingDirectionChangeThreshold: Double

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