ReadonlychildrenReadonlylocaltransform relative to the parent
When true (the default), updateWorldMatrix() recomposes localMatrix
from position, rotation and scale. Set to false to write
localMatrix yourself; flag changes with worldMatrixNeedsUpdate.
translation relative to the parent
rotation relative to the parent, as a unit quaternion
rotation relative to the parent, as Euler angles in radians applied in
XYZ order; kept in sync with quaternion
scale factors per axis
invisible objects and their children are not rendered
Readonlyworldtransform relative to the scene root
set to true after changing localMatrix manually
Add children. An object that already has a parent is moved.
this instance
ProtectedonCalled after worldMatrix was recomputed
Remove children. Objects that are not children are ignored.
this instance
Detach from the parent, if any
Set quaternion (and with it rotation) from the rotation part of a
matrix. The matrix must not contain scaling.
Call callback for this object and all its descendants, depth-first
Recompose localMatrix from position, quaternion and scale, after
bringing quaternion and rotation in sync (see the class description).
Update the world matrices of this object and its descendants.
recompute even if nothing was flagged as changed
Base class of everything in the scene graph. An object has a transform relative to its parent (
position,quaternionorrotation,scale, composed intolocalMatrix) and a list ofchildren.worldMatrixis the transform relative to the scene root,parent.worldMatrix × localMatrix, computed byupdateWorldMatrix()in a tree walk before each render.The rotation is stored twice, as a Quaternion and as Euler angles, and either can be written to.
updateLocalMatrix()compares both against their values at the last update and converts whichever changed into the other (the quaternion wins if both changed).A child inherits its parent's transform, so
planet.add(moon)andmoon.position.set(2, 0, 0)make the moon orbit whenplanet.rotation.ychanges. To orbit without spinning the parent, put an emptyObject3Din between as a pivot.