@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / LODSystem
Class: LODSystem ​
Defined in: systems/LODSystem.ts:58
Draws a simpler level of a model when it's small on screen, and nothing when it's past its cull size or distance (LODComponent).
Screen size is the share of the screen's height the object's bounding sphere covers, so it follows the camera's field of view and the object's scale. A default system, after the camera has moved for the frame. The editor shows level 0 and draws everything.
Implements ​
Constructors ​
Constructor ​
new LODSystem(isEditor?): LODSystem;Defined in: systems/LODSystem.ts:79
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
isEditor | boolean | false |
Returns ​
LODSystem
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/LODSystem.ts:59 |
bias | public | number | null | null | Multiplies every screen size. Below 1 drops to simpler levels sooner. Null follows the quality preset (low 0.6, medium 0.8, high 1, ultra 1.25). | systems/LODSystem.ts:67 |
switches | public | number | 0 | Level switches since the game started, for the profiler. | systems/LODSystem.ts:69 |
spread | public | number | 4 | Each object is looked at one frame in this many (all of them after the camera jumps): a level is chosen from distances that hardly change in a frame. 1 looks at every object every frame. | systems/LODSystem.ts:75 |
Methods ​
holds() ​
holds(url): boolean;Defined in: systems/LODSystem.ts:82
Whether any entity's level of detail holds this file now.
Parameters ​
| Parameter | Type |
|---|---|
url | string |
Returns ​
boolean
effectiveBias() ​
effectiveBias(world): number;Defined in: systems/LODSystem.ts:86
Parameters ​
| Parameter | Type |
|---|---|
world | World |
Returns ​
number
update() ​
update(world): void;Defined in: systems/LODSystem.ts:92
Parameters ​
| Parameter | Type |
|---|---|
world | World |
Returns ​
void
Implementation of ​
releaseEntity() ​
releaseEntity(world, entityId): string[];Defined in: systems/LODSystem.ts:336
Drop an entity's extra levels now (streaming freed its model) and say which files they came from, so the caller can release them.
Parameters ​
| Parameter | Type |
|---|---|
world | World |
entityId | number |
Returns ​
string[]

