@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / XRSessionSystem
Class: XRSessionSystem ​
Defined in: systems/XRSessionSystem.ts:28
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:38
Parameters ​
| Parameter | Type |
|---|---|
inputSystem? | XRInputSystem |
Returns ​
XRSessionSystem
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/XRSessionSystem.ts:29 |
Methods ​
update() ​
update(world): void;Defined in: systems/XRSessionSystem.ts:42
Parameters ​
| Parameter | Type |
|---|---|
world | World |
Returns ​
void
Implementation of ​
getCapabilities() ​
getCapabilities(): XrCapabilities;Defined in: systems/XRSessionSystem.ts:265
What the active session granted. NO_XR_CAPABILITIES when not presenting.
Returns ​
isPresenting() ​
isPresenting(): boolean;Defined in: systems/XRSessionSystem.ts:270
True while an immersive session is presenting.
Returns ​
boolean
getInputs() ​
getInputs(): XrInputState[];Defined in: systems/XRSessionSystem.ts:275
Convenience passthrough so consumers need only hold this system.

