Repository navigation
API 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.
new LODGroup(): LODGroup;LODGroup
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: number = 0.3;Defined in: src/engine/render/meshRenderer.ts:268
How long a crossfade lasts, in seconds.
forceLevel: number = -1;Defined in: src/engine/render/meshRenderer.ts:271
-1 chooses the level automatically; n always draws level n (for debugging).
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: 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.
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.
number
get enabled(): boolean;Defined in: src/engine/core/Component.ts:63
boolean
set enabled(value): void;Defined in: src/engine/core/Component.ts:67
boolean
void
get gameObject(): GameObject;Defined in: src/engine/core/Component.ts:43
Unity-style alias for node.
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.
boolean
get node(): GameObject;Defined in: src/engine/core/Component.ts:38
The node this component is on.
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).
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).
Readonly<TimeState>
get transform(): Transform;Defined in: src/engine/core/Component.ts:57
The Transform of the node this component is on, if it has one.
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.
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.
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.
string
InstantiateOptions = {}
This wiki is generated from docs/wiki/ and the myco module's source on every push to master. Change pages there in a pull request: edits made here are not kept.
Basics
Gameplay
Rendering
Audio
- Playing sound
- Why is there no sound?
- Playlists
- Interactive music
- Sound generators
- Spatial audio
- Audio mixer
- Live mixing
- Loudness
- Audio profiler
- Audio takes
Reference