Engine API
Phase order
Section titled βPhase orderβSystems run once per fixed tick in this exact order:
| # | Phase | Constant | Description |
|---|---|---|---|
| 1 | input | PHASE.INPUT | Sample input devices (keyboard, mouse, gamepad) at the top of the frame. |
| 2 | prePhysics | PHASE.PRE_PHYSICS | Apply forces/intents to rigid bodies before the physics step. |
| 3 | physics | PHASE.PHYSICS | Step the Rapier physics world (fixed timestep). |
| 4 | postPhysics | PHASE.POST_PHYSICS | Read physics results back; sync transforms from bodies to Object3D. |
| 5 | gameLogic | PHASE.GAME_LOGIC | General gameplay behavior. |
| 6 | animation | PHASE.ANIMATION | Advance animation graphs / mixers. |
| 7 | preRender | PHASE.PRE_RENDER | Final per-frame fixups (cameras, HUD state) before drawing. |
| 8 | render | PHASE.RENDER | Draw the frame. |