Skip to content

Node

Transform hierarchy: position, rotation, scale, children, and optional tags/collision layers. Create with Scene.addNode or Node.new().

Node.new() — construct an empty node.

MethodDescription
getPosition() / setPosition(x, y, z)Local position
getRotation() / setRotation(pitch, yaw, roll)Local rotation (radians)
pitch / pitch=(value)Pitch (radians)
yaw / yaw=(value)Yaw (radians)
roll / roll=(value)Roll (radians)
getScale() / setScale(x, y, z)Local scale
MethodDescription
getWorldPosition()World-space position
getWorldMatrix()World matrix
getForward() / getRight() / getUp()Direction vectors from rotation
lookAt(x, y, z)Orient to look at a point

getScreenPosition(camera, viewportWidth, viewportHeight) — returns [screenX, screenY, depth] or null if behind camera.

MethodDescription
addChild(child)Add a child node
getParent()Parent node
detach()Remove from parent
nodesChild nodes
animationsAnimation state map (name → AnimationState)
Method / propertyDescription
name / getName() / setName(name)Node name
node_idNode ID
getTags() / setTags(tags)Tags
getCollisionLayers() / setCollisionLayers(layers)Collision layers