![]() |
Lysa Nodes
0.0
Lysa Nodes — Scene Graph for the Lysa Engine
|
lysa::nodes::SceneTree SceneTree extends the engine's lysa::Scene (the GPU-facing scene container) and adds the node lifecycle, event wiring, and render-view management.
RotatingAssetScene derives from SceneTree directly; no intermediate custom class is needed:
SceneTree::attach(renderingWindow) binds the scene tree to a rendering window. Internally it:
subscribeEvents() which subscribes to PHYSICS_PROCESS, PROCESS, INPUT, RESIZED, PAUSED, and RESUMED.RenderView to the render target.onAttach() and onReady() on the scene tree._ready() on every child already in the tree.The attach call is made in the constructor of RotatingAssetScene after all other nodes except the camera hierarchy have been added:
attach(). Camera::_attachToScene reads SceneTree::isAttached() to decide whether to set the initial aspect ratio. If attach() has not been called yet, isAttached() is false and the aspect ratio is never initialised, resulting in a zero-size projection matrix.Once attached, SceneTree owns all event subscriptions. Each tick it:
child->_physicsProcess(delta) on all top-level children (which cascades recursively), then calls onPhysicsProcess(delta) on itself.child->_process(alpha) on all top-level children, then calls onProcess(alpha) on itself, then calls updateInstance on all MeshInstance descendants to push the new transforms to the GPU.InputEvent to onInput() and to all children via _input().RESIZED, calls onResize().The Application only needs to subscribe to PROCESS for the render() call:
Because the scene tree subscribed to PROCESS before the Application (during attach()), the scene's handler — which updates all node transforms and GPU instance data — always runs before render().
SceneConfiguration Pass a lysa::SceneConfiguration to the SceneTree constructor to tune GPU buffer sizes for large scenes:
The default configuration suits scenes up to several thousand instances.
Next : Camera