Object3D
Base class for most scene objects. Provides transform hierarchy, visibility, and serialization.
Extends EventDispatcher.
Constructor
const obj = new Object3D()
Properties
id— Auto-incrementing integer ID (readonly)uuid— UUID string (readonly)name— Optional name stringtype— Type string ('Object3D')parent— Parent Object3D (ornull)children— Array of child Object3Dsup— Up direction vector (default(0, 1, 0))position— Local position (Vector3)rotation— Local rotation as Euler (syncs withquaternion)quaternion— Local rotation as Quaternion (syncs withrotation)scale— Local scale (Vector3, default(1, 1, 1))matrix— Local transform matrix (Matrix4)matrixWorld— World transform matrix (Matrix4)matrixAutoUpdate— Auto-compute local matrix each frame (defaulttrue)matrixWorldAutoUpdate— Auto-compute world matrix (defaulttrue)matrixWorldNeedsUpdate— Force world matrix update this framevisible— Whether to render (defaulttrue)castShadow,receiveShadow— Shadow flags (defaultfalse)renderOrder— Override render sorting (default0)animations— Array of AnimationClipsuserData— Custom data object
Static
Object3D.DEFAULT_UP— Default up vector(0, 1, 0)Object3D.DEFAULT_MATRIX_AUTO_UPDATE— DefaulttrueObject3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE— Defaulttrue
Methods
Transform
applyMatrix4(matrix)— Apply matrix, decompose into position/rotation/scaleapplyQuaternion(q)— Apply rotationsetRotationFromAxisAngle(axis, angle),setRotationFromEuler(euler),setRotationFromMatrix(m),setRotationFromQuaternion(q)rotateOnAxis(axis, angle)— Rotate in local spacerotateOnWorldAxis(axis, angle)— Rotate in world spacerotateX(angle),rotateY(angle),rotateZ(angle)translateOnAxis(axis, distance)— Translate along local axistranslateX(d),translateY(d),translateZ(d)lookAt(x, y, z)orlookAt(vector3)— Face a point in world space
Space Conversion
localToWorld(vector)— Local → worldworldToLocal(vector)— World → local
Hierarchy
add(object, ...)— Add child(ren)remove(object, ...)— Remove child(ren)removeFromParent()— Remove self from parentclear()— Remove all childrenattach(object)— Add child while preserving world transform
Search
getObjectById(id),getObjectByName(name)getObjectByProperty(name, value)— First matchgetObjectsByProperty(name, value, result?)— All matches
World State
getWorldPosition(target),getWorldQuaternion(target),getWorldScale(target),getWorldDirection(target)
Traversal
traverse(callback)— Visit all descendantstraverseVisible(callback)— Visit visible descendants onlytraverseAncestors(callback)— Visit all ancestors
Matrix
updateMatrix()— Recompute local matrix from position/rotation/scaleupdateMatrixWorld(force?)— Recompute world matrices for this and descendantsupdateWorldMatrix(updateParents?, updateChildren?)— Selective update
Serialization
toJSON(meta?)— Serialize to JSONclone(recursive?)— Deep copycopy(source, recursive?)— Copy values from another Object3D
Events
added— Fired when added to a parentremoved— Fired when removed from a parentchildadded— Fired on parent when a child is addedchildremoved— Fired on parent when a child is removed