SceneNode
classin packageklyn.graphics3d
public class SceneNode
SceneNode

Object in a scene graph. One parent per node; cycles are forbidden. Local transforms are immutable matrices. Meshes/materials can be shared. Example: node = SceneNode("robot", mesh, material); scene.root.add(node)

Properties
Modifier and Type Member Description
public readonly property childCount
childCount as Int
Number of children, O(1).
public property isVisible
isVisible as Boolean = true
Hides this entire subtree when false.
public property material
material as Material
Immutable material.
public property mesh
mesh as Mesh
Optional geometry.
public property name
name as String
Name for selection/debugging.
public readonly property parent
parent as SceneNode
Parent, or null for roots.
public property transform
transform as Matrix4 = Matrix4()
Local-to-parent transform.
Constructors
Modifier and Type Member Description
public SceneNode
SceneNode(name as String = "", mesh as Mesh = null, material as Material = Material())
Creates an object or grouping node.
Methods
Modifier and Type Member Description
public add
add(child as SceneNode) as Void
Attaches a detached node; rejects null, cycles and multiple parents.
public bounds
bounds(parentTransform as Matrix4 = Matrix4()) as Bounds3d
Computes visible world bounds, O(nodes), using cached mesh bounds.
public childAt
childAt(index as Int) as SceneNode
Returns child i in O(1).
public clone
clone() as SceneNode
Deep-copies the node hierarchy, sharing immutable meshes/materials.
public remove
remove(child as SceneNode) as Boolean
Detaches a child, returning whether it belonged to this node.