CameraNode class final
A camera placed in the scene graph.
Being a node is the point: parenting a camera to a moving object is ordinary hierarchy rather than a special "follow" feature, and the view matrix is just the inverse of the node's world transform.
Constructors
- CameraNode({Projection? projection, String? name})
Properties
-
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
- lightChannels ↔ int
-
Which light channels this node accepts —
gfx-12n.getter/setter pairinherited - localMatrix → Matrix4
-
no setterinherited
- name ↔ String?
-
getter/setter pairinherited
- 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
- projection ↔ Projection
-
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
- viewMatrix → Matrix4
-
World-to-eye transform, recomputed only when the node moves.
no setter
- 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
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
-
readForward(
[Vector3? out]) → Vector3 - World-space forward direction, the node's local -Z.
-
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
-
viewProjection(
double aspect) → Matrix4 - Combined view-projection for a viewport of the given aspect ratio.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited