Class: Object3D

Object3D()

Base class for scene graph objects. Stores local transformation and parent-child relations.

Constructor

new Object3D()

Creates an Object3D with the default local transformation.
Source:

Classes

Object3D

Members

children

Source:

parent

Source:

position

Source:

rotation

Source:

scale

Source:

worldMatrix

Source:

Methods

add(child)

Attaches a child to this object. Reparents the child when it already belongs to another parent.
Parameters:
Name Type Description
child Object3D Child object to attach.
Source:
Throws:
- If the child is not an Object3D instance.
Type
TypeError

remove(child)

Detaches a child from this object. Does nothing when the child is not attached.
Parameters:
Name Type Description
child Object3D Child object to detach.
Source:
Throws:
- If the child is not an Object3D instance.
Type
TypeError

traverse(callback)

Visits this object and all descendants in depth-first order.
Parameters:
Name Type Description
callback function Visitor callback.
Source:
Throws:
- If the callback is not a function.
Type
TypeError

updateWorldMatrix(inputMatrix) → {void}

Updates world matrices for this object and its descendants.
Parameters:
Name Type Description
inputMatrix Float32Array | null | Object Parent world matrix or options object.
Properties
Name Type Attributes Description
parentWorldMatrix Float32Array | null <optional>
Parent world matrix override, or null for the root.
Source:
Throws:
- If the resolved parent world matrix is invalid.
Type
TypeError
Returns:
Type
void