LightNode class final
A light placed in the scene graph.
Direction comes from the node's local -Z, the same forward axis cameras use, so SceneNode.lookAt aims a spot light exactly as it aims a camera.
Constructors
Properties
- castsShadow ↔ bool
-
Whether this light wants a shadow map.
getter/setter pair
- channels ↔ int
-
Which channels this light shines on —
gfx-12n's own row.getter/setter pair -
children
→ List<
SceneNode> -
no setterinherited
-
childrenView
→ List<
SceneNode> -
Direct access for internal traversal, avoiding the unmodifiable copy.
no setterinherited
- color → Vector3
-
Linear RGB.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height ↔ double
-
How tall it is, along the node's local +Y.
getter/setter pair
- innerConeAngle ↔ double
-
getter/setter pair
- intensity ↔ double
-
How bright this light is, in the engine's own unit — see Photometric
for what that unit is worth in lumens, candela and lux.
getter/setter pair
- 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
- lightChannels ↔ int
-
Which light channels this node accepts —
gfx-12n.getter/setter pairinherited - localMatrix → Matrix4
-
no setterinherited
- name ↔ String?
-
getter/setter pairinherited
- outerConeAngle ↔ double
-
getter/setter pair
- ownBounds → Aabb3?
-
This node's own contribution to subtreeBounds, or null when it draws
nothing.
no setterinherited
- ownBoundsAreCullable → bool
-
Whether ownBounds may be culled.
no setterinherited
- parent → SceneNode?
-
no setterinherited
- range ↔ double
-
Distance at which a point or spot light stops contributing. Zero means
unbounded, matching glTF's default.
getter/setter pair
- 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
- subtreeAlwaysDrawn → bool
-
Whether anything in this subtree has opted out of frustum culling.
no setterinherited
- subtreeBounds → Aabb3?
-
What this node and everything under it occupies, or null when the subtree
draws nothing.
no setterinherited
- type ↔ LightType
-
getter/setter pair
- 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
- width ↔ double
-
How wide the rectangle is, in world metres, along the node's local +X —
gfx-77n. Ignored by every other kind.getter/setter pair - 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
childwhile 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
-
readDirection(
[Vector3? out]) → Vector3 - World-space direction the light points, i.e. the node's local -Z.
-
readDirectionToLight(
[Vector3? out]) → Vector3 - Direction towards the light, which is what shading maths wants.
-
readHalfHeight(
[Vector3? out]) → Vector3 - The half-height vector, local +Y scaled by half of height.
-
readHalfWidth(
[Vector3? out]) → Vector3 -
The rectangle's half-width vector in world space, i.e. local +X scaled by
half of width. Mutates and returns
out. -
readPosition(
[Vector3? out]) → Vector3 -
Reads the local position into
outto 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
-
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.
inherited
-
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