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 Object3Dsposition— 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)visible— Whether to render (defaulttrue)renderOrder— Override render sorting (default0)animations— Array of AnimationClipsuserData— Custom data object
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 descendants
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