Function readXrController
-
Parameters
- input: XrInputSource
The tracked input source (from XrInputManager).
Returns XrControllerComponents | null
The decoded components, or
nullwhen there is no gamepad. - input: XrInputSource
The tracked input source (from XrInputManager).
The decoded components, or null when there is no gamepad.
Decode an input source's
xr-standardgamepad into structured button/axis state for the current frame. Returnsnullwhen the source exposes no gamepad (e.g. a gaze or hand-tracking source). The result is a fresh snapshot each call, so it is safe to diff against the previous frame's snapshot for edge detection.