ReadonlygameRoot-level GameObjects in this scene.
The Engine driving this scene, or null when the scene is used
standalone (e.g. in tests). Assigned by the Engine that owns the scene.
Gives behaviors a path to engine-level resources — most usefully
scene.engine.ctx.device to build meshes / textures at runtime — without a
global singleton.
ReadonlytimeSimulation clock for this scene. Advanced by the Engine each frame
before Scene.update. Components read it via Component.time
for absolute time, frame count, FPS, and timeScale-aware delta.
Adds a root GameObject to the scene. Registers every component in the subtree with the scene's typed caches.
GameObject to add.
Removes a root GameObject from the scene if present. Unregisters every component in the subtree from the scene's typed caches.
GameObject to remove.
Recursively updates every root GameObject and its children.
Frame delta time in seconds.
Recursively refreshes per-frame render state on every root GameObject and its children. Call after update and any input/controller mutations so cached state (e.g. camera matrices) reflects the final transforms.
Active render context.
Returns the first DirectionalLight in the hierarchy whose GameObject (and every ancestor) is enabled, or null. Treated as the sun light by the renderer's atmosphere / shadow / lighting features. O(matches) via the directional-light cache.
Returns every MeshRenderer in the hierarchy whose GameObject and every ancestor is enabled. Used by the world geometry pass and shadow passes to build draw lists. O(matches) via the mesh-renderer cache.
Returns one component of the given type per root GameObject (the first match via GameObject.getComponent). Does not recurse into children.
Component subclass constructor used as a type filter.
Depth-first search for the first GameObject named name anywhere in the
hierarchy (roots and all descendants), or null if none matches. Names are
not unique, so this returns the first match in traversal order. Convenience
for behaviors that need to reference another object by name; for hot paths
cache the result rather than calling every frame.
Exact Function.name to match.
Collects every GameObject named name in the hierarchy (roots and all
descendants), in depth-first order.
Exact Function.name to match.
Registers a component with the scene's typed caches. Called by GameObject.addComponent (when the owning GameObject is in this scene) and by GameObject._setScene during subtree attachment. Internal — do not call directly.
Unregisters a component from the scene's typed caches. Counterpart to _onComponentAdded. Internal — do not call directly.
Top-level container for the GameObject hierarchy.
Holds the root-level GameObjects for a frame. Scene.update recursively ticks every component in the hierarchy; the renderer then queries the scene (via Scene.findCamera, Scene.findSunLight, Scene.collectMeshRenderers, Scene.getComponents) to build its per-pass draw lists.
The scene maintains typed caches of Camera, DirectionalLight, and MeshRenderer components so those lookups are O(matches) rather than walking the hierarchy every frame. Caches are kept in sync via GameObject add/remove and GameObject.addComponent / GameObject.removeComponent; descendants are tracked too.