Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / index / XREnvironmentSystem

Class: XREnvironmentSystem ​

Defined in: systems/XREnvironmentSystem.ts:172

Implements ​

Constructors ​

Constructor ​

ts
new XREnvironmentSystem(): XREnvironmentSystem;

Returns ​

XREnvironmentSystem

Properties ​

PropertyModifierTypeDefault valueDescriptionDefined in
runsWhilePausedreadonlytruetrueKeep 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/XREnvironmentSystem.ts:173

Methods ​

update() ​

ts
update(world, deltaTime?): void;

Defined in: systems/XREnvironmentSystem.ts:202

Parameters ​

ParameterTypeDefault value
worldWorldundefined
deltaTimenumber0

Returns ​

void

Implementation of ​

EcsSystem.update


getDetectedCount() ​

ts
getDetectedCount(): {
  planes: number;
  meshes: number;
};

Defined in: systems/XREnvironmentSystem.ts:330

How many pieces of real geometry are currently colliding. Script-facing.

Returns ​

ts
{
  planes: number;
  meshes: number;
}
NameTypeDefined in
planesnumbersystems/XREnvironmentSystem.ts:330
meshesnumbersystems/XREnvironmentSystem.ts:330

getDebugSnapshot() ​

ts
getDebugSnapshot(world): {
  kind: "plane" | "mesh";
  label: string | null;
  position: {
     x: number;
     y: number;
     z: number;
  };
  radius: number;
  emulated: boolean;
}[];

Defined in: systems/XREnvironmentSystem.ts:341

A census of every surface currently spawned: what it is, where it sits and roughly how big it is. Built for the template's post-session readout, so a mystery shape on the headset can be looked up by its label instead of guessed at — a small-radius entry at head height IS the mystery shape, and a clean list means whatever was seen did not come from this system.

Parameters ​

ParameterType
worldWorld

Returns ​


dispose() ​

ts
dispose(world): void;

Defined in: systems/XREnvironmentSystem.ts:912

Parameters ​

ParameterType
worldWorld

Returns ​

void

Implementation of ​

EcsSystem.dispose