@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 ​
new StreamingSystem(isEditor?): StreamingSystem;Defined in: streaming/StreamingSystem.ts:109
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
isEditor | boolean | false |
Returns ​
StreamingSystem
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(). | streaming/StreamingSystem.ts:87 |
settings | readonly | StreamingSettings | undefined | - | streaming/StreamingSystem.ts:88 |
Methods ​
expectStreamedContent() ​
expectStreamedContent(): void;Defined in: streaming/StreamingSystem.ts:112
Hydration calls this before creating entities of a snapshot that streams.
Returns ​
void
isActive() ​
isActive(): boolean;Defined in: streaming/StreamingSystem.ts:117
Whether model loads go through here (never in the editor).
Returns ​
boolean
setFocus() ​
setFocus(focus): void;Defined in: streaming/StreamingSystem.ts:122
What distance is measured from. Null: the camera.
Parameters ​
| Parameter | Type |
|---|---|
focus | StreamingFocus |
Returns ​
void
getFocus() ​
getFocus(): StreamingFocus;Defined in: streaming/StreamingSystem.ts:127
Returns ​
refresh() ​
refresh(): void;Defined in: streaming/StreamingSystem.ts:132
Check distances on the next frame instead of waiting for the interval.
Returns ​
void
requestModelLoad() ​
requestModelLoad(entityId, start): void;Defined in: streaming/StreamingSystem.ts:138
Parameters ​
| Parameter | Type |
|---|---|
entityId | number |
start | () => void |
Returns ​
void
Implementation of ​
ModelLoadGate.requestModelLoadupdate() ​
update(world, deltaTime?): void;Defined in: streaming/StreamingSystem.ts:145
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
world | World | undefined |
deltaTime | number | 0 |
Returns ​
void
Implementation of ​
getStats() ​
getStats(world): StreamingStats;Defined in: streaming/StreamingSystem.ts:269
What's loaded and what isn't, for debugging and the profiler.
Parameters ​
| Parameter | Type |
|---|---|
world | World |

