VrApi
interface VrApi
Offers VR-related functionality. Accessible through Player.vr
Properties
| Name | Summary |
|---|---|
| gyroscopicOrientationProvider | abstract var gyroscopicOrientationProvider: OrientationProvider? The gyroscopic OrientationProvider that is used for VR control. |
| isGyroscopeEnabled | abstract var isGyroscopeEnabled: Boolean Specifies whether the gyroscope of the device is enabled. |
| isStereo | abstract var isStereo: Boolean Specifies whether stereo mode is enabled. |
| isTouchControlEnabled | abstract var isTouchControlEnabled: Boolean Specifies whether the touch controls of the device are enabled. |
| touchOrientationProvider | abstract var touchOrientationProvider: OrientationProvider? The touch OrientationProvider that is used for VR control. |
| viewingDirection | abstract var viewingDirection: ViewingDirection? The current viewing direction. |
| viewingDirectionChangeEventInterval | abstract var viewingDirectionChangeEventInterval: Double The minimal interval between consecutive VrViewingDirectionChanges. The default value is 250ms. |
| viewingDirectionChangeThreshold | abstract var viewingDirectionChangeThreshold: Double The number of degrees that the viewport can change before the VrViewingDirectionChange is triggered. The default value is 5°. |
Functions
| Name | Summary |
|---|---|
| moveViewingDirection | 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. |
| setVrRenderer | abstract fun setVrRenderer(renderer: VrRenderer?) Sets the VrRenderer that is used to modify VR properties. |