![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
Fixed-step rigid-body dynamics: integrates, resolves pairwise collisions, writes poses back. More...
#include <physics_system.h>
Public Member Functions | |
| void | fixedUpdate (FrameContext &ctx) override |
| Execute this system at the fixed simulation rate. | |
| bool | isReplayed () const override |
| Re-run during a replay: it moves the world from state and command, deterministically. | |
| Public Member Functions inherited from Vkm::Engine::System | |
| virtual void | init (FrameContext &ctx) |
| Called once after all systems are registered, before the first update. | |
| virtual void | shutdown () |
| Called once on engine shutdown. | |
| virtual void | update (FrameContext &ctx) |
| Execute this system for the current frame. | |
Fixed-step rigid-body dynamics: integrates, resolves pairwise collisions, writes poses back.
Runs on the tick in SystemStage::Simulation, ahead of HierarchySystem, so the Transforms it writes reach WorldTransform the same frame. Enqueues CollisionEvent / TriggerEvent as contacts begin, last and end, on live ticks only; a replayed tick already reported.
A parented body simulates in world space (worldPoseOf) and is mapped back relative to its parent. The parent's pose is taken once at gather, so a parent moving mid-tick is not followed, and a scaled parent is not handled (a ColliderPart is unscaled).
|
overridevirtual |
Execute this system at the fixed simulation rate.
Called 0+ times per frame; the step is ctx.clock.getFixedStep().
Runs before any producer stage, so ctx.visibility and ctx.ui are null here. ctx.poses is set by SkeletalAnimationSystem's own fixedUpdate, so a later Simulation system reads this tick's pose.
| ctx | This frame's services; see above for which products are set. |
Reimplemented from Vkm::Engine::System.
|
inlineoverridevirtual |
Re-run during a replay: it moves the world from state and command, deterministically.
Reimplemented from Vkm::Engine::System.