Optional parameters for initializing the GameObject.
Stable identity for this object, unique within a session. Auto-generated for runtime-created objects; the editor overwrites it with a persistent id when projecting a saved document so references, selection, and prefab links survive save / load / undo.
Whether this GameObject is active and should be updated and rendered.
Display/lookup name (not unique).
ReadonlytransformThis object's transform: local TRS plus the lazily-cached world matrix. The GameObject.position, GameObject.rotation, and GameObject.scale accessors forward to it.
ReadonlychildrenChild GameObjects whose transforms are relative to this one.
Parent GameObject, or null if this is a root.
Scene this GameObject currently belongs to, or null when detached. Set by Scene.add and propagated down to descendants by addChild; cleared by Scene.remove. Used by the scene to maintain typed component caches without a per-frame hierarchy walk. Do not assign directly — use the scene/parent APIs.
Local-space rotation relative to parent. Forwards to transform.
World-space position, recovered from the parent chain. Forwards to Transform.worldPosition; returns a transform-owned Vec3 (copy before mutating). Use getWorldPosition for caller-owned storage.
World-space rotation, recovered from the parent chain. Forwards to Transform.worldRotation; returns a transform-owned Quaternion (copy before mutating). Use getWorldRotation for caller-owned storage.
World-space scale, recovered from the parent chain. Forwards to Transform.worldScale; returns a transform-owned Vec3 (copy before mutating). Use getWorldScale for caller-owned storage.
Allocation-free worldPosition. Forwards to Transform.getWorldPosition.
Optionalout: Vec3Allocation-free worldRotation. Forwards to Transform.getWorldRotation.
Optionalout: QuaternionAllocation-free worldScale. Forwards to Transform.getWorldScale.
Optionalout: Vec3Sets the local position in place. Shorthand for position.set(x, y, z).
This GameObject, for chaining.
Sets the local scale in place. Shorthand for scale.set(x, y, z).
This GameObject, for chaining.
Sets the local rotation by copying the given quaternion's components in place.
This GameObject, for chaining.
Sets the local rotation from intrinsic XYZ Euler angles (radians) in place.
Shorthand for rotation.setEuler(x, y, z).
This GameObject, for chaining.
Sets the local rotation to rad radians around axis in place.
Shorthand for rotation.setAxisAngle(axis, rad).
This GameObject, for chaining.
Attaches a component, binds its Component.gameObject, and runs onAttach.
Component instance to attach.
The same component, for chaining.
Detaches a component (calling its onDetach) if it is attached to this GameObject.
The component instance to remove.
Reparents another GameObject under this one.
Note: this does not remove the child from any previous parent's children list.
GameObject to add as a child.
Depth-first search this subtree for the first GameObject named name.
Convenience for wiring up references inside behaviors; for hot paths cache
the result rather than searching every frame.
Exact Function.name to match.
When true, this object is considered before its descendants. Defaults to false (searches descendants only).
The first matching GameObject, or null.
Appends every GameObject named name in this subtree to out, in
depth-first order.
Exact Function.name to match.
Array the matches are pushed onto.
When true, this object is considered before its descendants. Defaults to false (searches descendants only).
out, for chaining.
Returns true iff this GameObject and every ancestor up to the root is enabled. Used by the scene's cached component lookups to skip components whose owning subtree is currently disabled.
Sets the scene this GameObject (and all descendants) belongs to, registering/unregistering their components with the scene's caches. Called by Scene.add / Scene.remove and propagated by addChild. Internal — do not call directly.
Returns a fresh copy of this GameObject's world transform.
Delegates to Transform.worldMatrix, which is cached and recomputed only when this object's or an ancestor's transform changed. Allocates a Mat4 copy so the caller owns it; for hot-loop callers that supply their own storage, prefer GameObject.localToWorldInto.
Allocation-free variant of localToWorld: copies the cached world
matrix into out and returns it. The cache is refreshed on read, so this
reflects any transform changes made this frame. The caller owns out.
Use this in per-frame loops (engine bucketing, light update, etc.).
Updates every attached component, then recursively updates each child.
Frame delta time in seconds.
Refreshes per-frame render state on every attached component, then recursively on each child. Called after update and any controller input that mutates the transform, so cached values (e.g. camera view / projection matrices) reflect the final transform for the frame.
Active render context.
Container for transform, children, and components.
Forms a parent/child scene graph: each GameObject has its own local TRS (position/rotation/scale) and inherits its parent's world transform via GameObject.localToWorld. Behavior is added by attaching Component instances; per-frame updates flow recursively through GameObject.update.