Skip to main content

Module ragdoll

Module ragdoll 

Source
Expand description

Ragdolls for humanoid rigs: when Ragdoll::active turns on, the character’s body is rebuilt from physics capsules (pelvis, chest, head, upper arms, forearms, thighs, shins) joined by ball joints, starting exactly in the pose the clip was in and moving with the velocity it is given. The skeleton then follows the bodies every frame (hands and feet ride on their forearms and shins); turning it off removes the bodies and the clip takes over again.

The capsules collide with the world but not with each other (RAGDOLL_GROUP). They are transient objects: not saved, not listed in the hierarchy.

ctx.ragdoll(monster, hit * 40.0); // collapse, pushed the way it was hit

Structs§

Ragdoll
Physics-driven body for an animated humanoid.

Constants§

RAGDOLL_GROUP
Collision layer of ragdoll capsules: they hit everything else, not one another.