@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / XRInputSystem
Class: XRInputSystem ​
Defined in: systems/XRInputSystem.ts:161
Implements ​
Constructors ​
Constructor ​
new XRInputSystem(): XRInputSystem;Returns ​
XRInputSystem
Methods ​
attachSession() ​
attachSession(session): void;Defined in: systems/XRInputSystem.ts:199
Bind to a session. Called by XRSessionSystem on session start.
Parameters ​
| Parameter | Type |
|---|---|
session | XRSession |
Returns ​
void
detachSession() ​
detachSession(): void;Defined in: systems/XRInputSystem.ts:212
Unbind and drop all per-source state.
Returns ​
void
update() ​
update(world): void;Defined in: systems/XRInputSystem.ts:236
Parameters ​
| Parameter | Type |
|---|---|
world | World |
Returns ​
void
Implementation of ​
getInputs() ​
getInputs(): XrInputState[];Defined in: systems/XRInputSystem.ts:384
Every input source active this frame.
Returns ​
getInput() ​
getInput(handedness): XrInputState | null;Defined in: systems/XRInputSystem.ts:389
The first source for a hand, or null. Prefer this for hand-specific logic.
Parameters ​
| Parameter | Type |
|---|---|
handedness | XrHandedness |
Returns ​
XrInputState | null
getHandInput() ​
getHandInput(handedness): XrInputState | null;Defined in: systems/XRInputSystem.ts:407
The ARTICULATED source for a hand — the one carrying joint poses.
Distinct from getInput because a hand can be backed by several sources at once: a Quest reports a controller AND a tracked hand for the same handedness, and Vision Pro adds a transient pinch alongside its two persistent hands. getInput returns whichever was seen first, so anything needing JOINTS has to ask for them specifically — taking the first match silently handed pose detection a controller with no joints, and no pose ever fired.
Parameters ​
| Parameter | Type |
|---|---|
handedness | XrHandedness |
Returns ​
XrInputState | null
isSelecting() ​
isSelecting(): boolean;Defined in: systems/XRInputSystem.ts:417
True while ANY source is selecting — the portable "is the user acting" check.
Returns ​
boolean
dispose() ​
dispose(): void;Defined in: systems/XRInputSystem.ts:424
Returns ​
void

