![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
Keeps a ragdoll's bodies in step with whichever is in charge. More...
#include <ragdoll_system.h>
Public Member Functions | |
| void | init (FrameContext &ctx) override |
| Called once after all systems are registered, before the first update. | |
| void | fixedUpdate (FrameContext &ctx) override |
| Execute this system at the fixed simulation rate. | |
| void | shutdown () override |
| Drops the observer registration, so nothing calls a dead system. | |
| void | onEntityDestroyed (EntityId id) override |
| Destroy a ragdoll's bones when the thing they belong to goes. | |
| Public Member Functions inherited from Vkm::Engine::System | |
| virtual bool | isReplayed () const |
| Whether this system may be re-run over a tick that already happened. | |
| virtual void | update (FrameContext &ctx) |
| Execute this system for the current frame. | |
Keeps a ragdoll's bodies in step with whichever is in charge.
The bodies exist, and so simulate, whether or not the ragdoll is active. Inactive, they are kinematic hitboxes (see isPosedByAnimation) placed from the animated pose every tick with its velocity, so activation hands the solver the character's real shape and motion.
Runs on the tick, after SkeletalAnimationSystem, whose pose it reads, and before PhysicsSystem, so the solver reads these bone transforms the same step.
|
overridevirtual |
Called once after all systems are registered, before the first update.
| ctx | The first frame's context; its products are all null. |
Reimplemented from Vkm::Engine::System.
|
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.
|
overridevirtual |
Destroy a ragdoll's bones when the thing they belong to goes.
A plain destroyEntity does not walk children, and a bone moved out of the group escapes one that does; an observer catches every destroy, gameplay's included.
| id | The entity being destroyed. |
Implements Vkm::Engine::ISceneObserver.