Skip to content

API Class LODGroup

github-actions[bot] edited this page Dec 2, 2026 · 3 revisions

Class: LODGroup

Defined in: src/engine/render/meshRenderer.ts:255

Draws its node's meshes in less detail as they get smaller on screen (ADR 0542 §2). It controls every MeshRenderer (and the animation plugin's SkinnedMeshRenderer) on its node and below, stopping at a nested LODGroup: they switch level together, each mesh drawing its own generated level (its last when it has fewer). Levels are chosen per camera from the group's screen-relative height: its size as a share of the view's height, times the quality tier's lodBias.

Extends

Constructors

Constructor

new LODGroup(): LODGroup;

Returns

LODGroup

Inherited from

Component.constructor

Properties

fade

fade: LodFade = "crossfade";

Defined in: src/engine/render/meshRenderer.ts:265

How a level change looks: at once, or a dithered crossfade over fadeDuration (when the quality tier allows it).


fadeDuration

fadeDuration: number = 0.3;

Defined in: src/engine/render/meshRenderer.ts:268

How long a crossfade lasts, in seconds.


forceLevel

forceLevel: number = -1;

Defined in: src/engine/render/meshRenderer.ts:271

-1 chooses the level automatically; n always draws level n (for debugging).


levels

levels: number[] = [];

Defined in: src/engine/render/meshRenderer.ts:262

Transition heights, descending, one per level (at most 8): level i draws while the screen-relative height is at least levels[i]; below the last value the group isn't drawn (a last value of 0 never culls). Empty: automatic, derived from the meshes' measured simplification error and their import settings' pixelError.


size

size: number = 0;

Defined in: src/engine/render/meshRenderer.ts:277

The group's size in world units, the measure the screen height is taken of. 0: automatic, the diagonal of its meshes' combined bounds times the node's largest world scale.

Accessors

currentLevel

Get Signature

get currentLevel(): number;

Defined in: src/engine/render/meshRenderer.ts:284

The level drawn for the main camera (the enabled Camera with the lowest depth), -1 while the group is too small to draw (visibility is then "lodCulled"); 0 with no camera. Read-only; the same in the editor, the player and a headless World.

Returns

number


enabled

Get Signature

get enabled(): boolean;

Defined in: src/engine/core/Component.ts:63

Returns

boolean

Set Signature

set enabled(value): void;

Defined in: src/engine/core/Component.ts:67

Parameters
value

boolean

Returns

void

Inherited from

Component.enabled


gameObject

Get Signature

get gameObject(): GameObject;

Defined in: src/engine/core/Component.ts:43

Unity-style alias for node.

Returns

GameObject

Inherited from

Component.gameObject


isActiveAndEnabled

Get Signature

get isActiveAndEnabled(): boolean;

Defined in: src/engine/core/Component.ts:74

True when enabled, the node is active in the hierarchy, and the node is in a loaded world.

Returns

boolean

Inherited from

Component.isActiveAndEnabled


node

Get Signature

get node(): GameObject;

Defined in: src/engine/core/Component.ts:38

The node this component is on.

Returns

GameObject

Inherited from

Component.node


owner

Get Signature

get owner(): GameObject;

Defined in: src/engine/core/Component.ts:51

The node this component acts for: the node itself when attached directly, or the parent node when this component lives on a component node (ADR 0009).

Returns

GameObject

Inherited from

Component.owner


time

Get Signature

get time(): Readonly<TimeState>;

Defined in: src/engine/core/Component.ts:99

This component's World's clock (ADR 0032): the same values as Time, but safe to read outside the World's frame too (after an await, say).

Returns

Readonly<TimeState>

Inherited from

Component.time


transform

Get Signature

get transform(): Transform;

Defined in: src/engine/core/Component.ts:57

The Transform of the node this component is on, if it has one.

Returns

Transform

Inherited from

Component.transform


visibility

Get Signature

get visibility(): LodVisibility;

Defined in: src/engine/render/meshRenderer.ts:289

Why the group is or isn't drawn for the main camera: "drawn", "lodCulled", "offScreen" or "occluded"; "drawn" with no camera.

Returns

LodVisibility


world

Get Signature

get world(): WorldHandle;

Defined in: src/engine/core/Component.ts:88

A handle on this component's World (ADR 0132): the same one Engine.findWorld returns. Load a scene into it, pause, connect or destroy it: this.world.loadScene("scenes/level2.scene.json"). Throws for a World no Engine owns.

Returns

WorldHandle

Inherited from

Component.world

Methods

instantiate()

instantiate(prefabPath, options?): GameObject;

Defined in: src/engine/core/Component.ts:109

Instantiate a prefab in this component's World (ADR 0034), like GameObject.instantiate. Use it in code that may run after an await: by then the frame is over and the current World is the Engine's default one, which may not be this component's. A parent from another World throws.

Parameters

prefabPath

string

options?

InstantiateOptions = {}

Returns

GameObject

Inherited from

Component.instantiate

Clone this wiki locally