@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / XRSessionSystem
Class: XRSessionSystem ​
Defined in: systems/XRSessionSystem.ts:27
Owns the immersive-session lifecycle and fans XR events out to Behaviours.
Detects session start/end by polling renderer.xr.isPresenting rather than binding to sessionstart/sessionend: the session may already be running before this system is registered (the consumer owns the entry button), and polling a boolean makes the system correct regardless of construction order.
Hook dispatch mirrors ImageTargetAnchorSystem's AR precedent — walk live ScriptComponent.scriptInstances and call the public no-op hook — so XR and AR extend Behaviour the same way.
Implements ​
Constructors ​
Constructor ​
new XRSessionSystem(inputSystem?): XRSessionSystem;Defined in: systems/XRSessionSystem.ts:36
Parameters ​
| Parameter | Type |
|---|---|
inputSystem? | XRInputSystem |
Returns ​
XRSessionSystem
Methods ​
update() ​
update(world): void;Defined in: systems/XRSessionSystem.ts:40
Parameters ​
| Parameter | Type |
|---|---|
world | World |
Returns ​
void
Implementation of ​
getCapabilities() ​
getCapabilities(): XrCapabilities;Defined in: systems/XRSessionSystem.ts:242
What the active session granted. NO_XR_CAPABILITIES when not presenting.
Returns ​
isPresenting() ​
isPresenting(): boolean;Defined in: systems/XRSessionSystem.ts:247
True while an immersive session is presenting.
Returns ​
boolean
getInputs() ​
getInputs(): XrInputState[];Defined in: systems/XRSessionSystem.ts:252
Convenience passthrough so consumers need only hold this system.

