Skip to content

@relu-interactives/spatial-ecs


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

Class: StreamingSystem ​

Defined in: streaming/StreamingSystem.ts:86

Loads and frees regions of a big world as the player moves: models under a StreamingComponent load when the player comes within its load distance and are freed once they're past its unload distance. Every model load in a world with streamed content goes through here, so models load nearest first.

A default system. It does nothing in the editor, which always shows everything, and nothing in a world without streamed content.

Implements ​

Constructors ​

Constructor ​

ts
new StreamingSystem(isEditor?): StreamingSystem;

Defined in: streaming/StreamingSystem.ts:109

Parameters ​

ParameterTypeDefault value
isEditorbooleanfalse

Returns ​

StreamingSystem

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().streaming/StreamingSystem.ts:87
settingsreadonlyStreamingSettingsundefined-streaming/StreamingSystem.ts:88

Methods ​

expectStreamedContent() ​

ts
expectStreamedContent(): void;

Defined in: streaming/StreamingSystem.ts:112

Hydration calls this before creating entities of a snapshot that streams.

Returns ​

void


isActive() ​

ts
isActive(): boolean;

Defined in: streaming/StreamingSystem.ts:117

Whether model loads go through here (never in the editor).

Returns ​

boolean


setFocus() ​

ts
setFocus(focus): void;

Defined in: streaming/StreamingSystem.ts:122

What distance is measured from. Null: the camera.

Parameters ​

ParameterType
focusStreamingFocus

Returns ​

void


getFocus() ​

ts
getFocus(): StreamingFocus;

Defined in: streaming/StreamingSystem.ts:127

Returns ​

StreamingFocus


refresh() ​

ts
refresh(): void;

Defined in: streaming/StreamingSystem.ts:132

Check distances on the next frame instead of waiting for the interval.

Returns ​

void


requestModelLoad() ​

ts
requestModelLoad(entityId, start): void;

Defined in: streaming/StreamingSystem.ts:138

Parameters ​

ParameterType
entityIdnumber
start() => void

Returns ​

void

Implementation of ​

ts
ModelLoadGate.requestModelLoad

update() ​

ts
update(world, deltaTime?): void;

Defined in: streaming/StreamingSystem.ts:145

Parameters ​

ParameterTypeDefault value
worldWorldundefined
deltaTimenumber0

Returns ​

void

Implementation of ​

EcsSystem.update


getStats() ​

ts
getStats(world): StreamingStats;

Defined in: streaming/StreamingSystem.ts:269

What's loaded and what isn't, for debugging and the profiler.

Parameters ​

ParameterType
worldWorld

Returns ​

StreamingStats