group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
RagdollSystem.hpp File Reference

Spawn / despawn ragdolls and tick their per-frame state. More...

Include dependency graph for RagdollSystem.hpp:
This graph shows which files directly or indirectly include this file:

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 &registry, entt::entity character)
 Build a 15-body humanoid ragdoll for the dead character.
void systems::destroyRagdoll (Registry &registry, entt::entity character)
 Destroy the ragdoll bodies and joints owned by a character.
void systems::runRagdolls (Registry &registry, float dt)
 Per-tick ragdoll bookkeeping: advance age, optionally tick the cleanup timer for old corpses.

Detailed Description

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.