@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
Properties ​
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
runsWhilePaused | readonly | true | true | Keep ticking while the world is paused. Leave it unset for anything that moves the game on: such a system stops at world.pause() and picks up where it was at world.resume(). | systems/XRInputSystem.ts:162 |
Methods ​
attachSession() ​
attachSession(session): void;Defined in: systems/XRInputSystem.ts:200
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:213
Unbind and drop all per-source state.
Returns ​
void
update() ​
update(world): void;Defined in: systems/XRInputSystem.ts:237
Parameters ​
| Parameter | Type |
|---|---|
world | World |
Returns ​
void
Implementation of ​
getInputs() ​
getInputs(): XrInputState[];Defined in: systems/XRInputSystem.ts:385
Every input source active this frame.
Returns ​
getInput() ​
getInput(handedness): XrInputState | null;Defined in: systems/XRInputSystem.ts:390
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:408
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:418
True while ANY source is selecting — the portable "is the user acting" check.
Returns ​
boolean
dispose() ​
dispose(): void;Defined in: systems/XRInputSystem.ts:425
Returns ​
void

