![]() |
Lysa Nodes
0.0
Lysa Nodes — Scene Graph for the Lysa Engine
|
RotatingAssetScene::onProcess The asset rotation is implemented in RotatingAssetScene::onProcess, which SceneTree calls once per rendered frame after propagating _process to all child nodes.
rotationAngle is incremented by alpha * ROTATION_SPEED each call, so the angular velocity is constant regardless of frame rate. ROTATION_SPEED is 0.025f rad/s.
Once rotationAngle exceeds 2π the full circle is subtracted to prevent floating-point drift over long runtimes.
setTransform Node::setTransform calls updateGlobalTransform which cascades to every descendant in the subtree. For each MeshInstance descendant, MeshInstance::updateGlobalTransform pushes the new world transform and AABB to the GPU-side lysa::MeshInstance immediately. There is no equivalent of the manual SceneTree::onProcess base-class call; SceneTree itself handles the GPU sync via updateInstance after onProcess returns.
onProcess call order The SceneTree PROCESS handler executes in this order each frame:
child->_process(alpha) for each top-level child (cascades recursively).onProcess(alpha) — the RotatingAssetScene override runs here.updateInstance — walks the tree and copies every MeshInstance's current transform and AABB into the GPU per-frame buffer.render() — called by the Application's PROCESS subscription, which was registered after the scene tree's subscription.Always mutate nodes inside onProcess (step 2) or inside child nodes' onProcess callbacks (step 1) so that updateInstance (step 3) sees the final transforms for the current frame.
| Symbol | Description |
|---|---|
lysa::float4x4 | Row-major 4×4 matrix |
float4x4::identity() | Identity matrix |
float4x4::rotation_x/y/z(radians) | Single-axis rotation matrix |
float4x4::translation(x, y, z) | Translation matrix |
float4x4::scale(s) | Uniform scale matrix |
lysa::mul(A, B) | Matrix multiplication (A applied first, then B) |
lysa::radians(degrees) | Degrees-to-radians conversion |
lysa::perspective(fov, aspect, near, far) | Reversed-Z perspective projection |
lysa::quaternion | Quaternion type |
lysa::euler_angles(q) | Extracts Euler angles from a quaternion |
Next : Application class