LodGroup class final

Picks one of several meshes by how much of the screen the object covers.

A node rather than a renderer feature: the choice is a property of the object, the renderer already walks a flat registry, and hiding the levels it is not using keeps culling and picking honest without either of them knowing LODs exist.

Levels are given finest-first and sorted on construction, so declaring them out of order is not a silent bug.

Inheritance

Constructors

LodGroup({required List<LodLevel> levels, String? name})
LodGroup.forMaterials({required MeshGeometry mesh, required List<Material> materials, required List<double> maxScreenFractions, String? name})
Builds a group from one mesh drawn with several materials.
factory

Properties

activeLevel int
Index of the level currently visible.
no setter
activeNode MeshNode
no setter
children List<SceneNode>
no setterinherited
childrenView List<SceneNode>
Direct access for internal traversal, avoiding the unmodifiable copy.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
inverseWorldMatrix → Matrix4
The world-to-node transform, cached on worldVersion.
no setterinherited
layerMask int
Bitmask filtered against a render view's mask, in the manner of three.js layers. Bit 0 is the default layer.
getter/setter pairinherited
levels List<LodLevel>
no setter
localMatrix → Matrix4
no setterinherited
name String?
getter/setter pairinherited
parent SceneNode?
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scene Scene?
The scene this node currently belongs to, if any.
no setterinherited
visible bool
Whether this node and its subtree are drawn.
getter/setter pairinherited
visibleInHierarchy bool
True when this node and every ancestor is visible.
no setterinherited
worldMatrix → Matrix4
The node-to-world transform, always current.
no setterinherited
worldVersion int
Changes whenever worldMatrix changes. Use it as an invalidation key.
no setterinherited

Methods

add(SceneNode child) → void
Adds child, keeping its local transform (so it moves with this node).
inherited
attach(SceneNode child) → void
Adds child while preserving its current world transform.
inherited
bindToScene(Scene? scene) → void
Binds this node's subtree to scene. Called by Scene for its own root; user code attaches nodes with add instead.
inherited
findByName(String target) SceneNode?
First descendant with a matching name, or null.
inherited
lookAt(Vector3 target, {Vector3? up}) → void
Points the node's local -Z at target, given in world space.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAttachedToScene(Scene scene) → void
Hook for subclasses to register themselves in the scene's flat registries.
override
onDetachedFromScene(Scene scene) → void
override
readPosition([Vector3? out]) → Vector3
Reads the local position into out to avoid allocating.
inherited
readRotation([Quaternion? out]) → Quaternion
inherited
readScale([Vector3? out]) → Vector3
inherited
readWorldPosition([Vector3? out]) → Vector3
inherited
remove(SceneNode child) → void
inherited
removeFromParent() → void
Detaches this node from its parent.
inherited
screenFraction(CameraNode camera, {double? verticalFieldOfView, double? orthographicHeight}) double
How much of the viewport's height this object's bounding sphere covers.
select(CameraNode camera, {double? verticalFieldOfView, double? orthographicHeight}) int
Chooses a level for camera and returns its index.
setLocalForward(Vector3 direction, {Vector3? up}) → void
Aims the node's local -Z along direction, expressed in the parent's space.
inherited
setLocalMatrix(Matrix4 value) → void
Replaces the local transform by decomposing a matrix.
inherited
setPosition(double x, double y, double z) → void
inherited
setPositionFrom(Vector3 value) → void
inherited
setRotation(Quaternion value) → void
inherited
setRotationYawPitchRoll(double yaw, double pitch, double roll) → void
Yaw about Y, then pitch about X, then roll about Z — the order that reads naturally for cameras and turntables.
inherited
setScale(double x, double y, double z) → void
inherited
setUniformScale(double value) → void
inherited
toString() String
A string representation of this object.
override
translate(double dx, double dy, double dz) → void
inherited
traverse(void visit(SceneNode child)) → void
Walks this node and its descendants.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited