XR · interface
ControllerState
One controller, as much of it as this engine reads.
Explained in XR.
interface ControllerStateimport type { ControllerState } from '@driftengine/xr';Properties
| Name | Type | Description |
|---|---|---|
handednessreadonly | Handedness | |
targetRayModereadonly | string | How the source is aimed: tracked-pointer, gaze or screen. |
trackedreadonly | boolean | Whether a pose was available this frame. False while a controller is out of view. |
gripMatrixreadonly | Float32Array | null | The grip transform's matrix, valid only while tracked. |
rayMatrixreadonly | Float32Array | null | Where the source is aiming, which is not where it is held. |
buttonsreadonly | readonly number[] | Analogue values in the profile's order, and zero for a button the device does not have. |
pressedreadonly | readonly boolean[] | |
axesreadonly | readonly number[] |