|
group2 0.1.0
CSE 125 Group 2
|
Spawn / despawn ragdolls and tick their per-frame state. More...
#include "ecs/registry/Registry.hpp"Go to the source code of this file.
Namespaces | |
| namespace | systems |
| Client-only input sampling system — split into two halves so mouse look can run every iterate() (smooth camera at any FPS) while movement keys run once per physics tick group (server-consistent). | |
Functions | |
| entt::entity | systems::spawnRagdoll (Registry ®istry, entt::entity character) |
| Build a 15-body humanoid ragdoll for the dead character. | |
| void | systems::destroyRagdoll (Registry ®istry, entt::entity character) |
| Destroy the ragdoll bodies and joints owned by a character. | |
| void | systems::runRagdolls (Registry ®istry, float dt) |
| Per-tick ragdoll bookkeeping: advance age, optionally tick the cleanup timer for old corpses. | |
Spawn / despawn ragdolls and tick their per-frame state.
spawnRagdoll(character) allocates 15 capsule rigid bodies sized to match a typical 72-unit Quake-style character, links them with point / hinge / cone-twist joints, and attaches the parent Ragdoll component to the character entity.
The character's Velocity (linear) and AngularVelocity (if present) are inherited by the torso so the corpse keeps the player's pre-death motion — feels much better than a stationary spawn.
On settle (all bodies asleep), runRagdolls() increments age and gameplay code can decide when to fade the corpse out.