![]() |
vkmEngine 1.0.0
A C++ game engine · vkmengine.com
|
One bone of a ragdoll, and the body that moves it. More...
#include <ragdoll.h>
Public Attributes | |
| int32_t | bone = -1 |
| Index into the rig's bone array. | |
| EntityId | body {} |
| The entity simulating it. | |
| glm::mat4 | bodyFromBone = glm::mat4(1.0f) |
| Bone space -> body space: the bone as the body sees it. | |
| glm::vec3 | lastPosition = {0.0f, 0.0f, 0.0f} |
| Where the pose put the body last tick, world space; runtime, not serialized. | |
One bone of a ragdoll, and the body that moves it.
A body covers its bone rather than sitting on it (a thigh capsule's origin is mid-thigh, the bone's is the hip), so bodyFromBone is recorded at build and the pose is the body's transform put back through it. It carries the rig's scale at that build (Ragdoll::rigScale): a rig that changes scale wants its ragdoll rebuilt.
| glm::vec3 Vkm::Engine::RagdollBone::lastPosition = {0.0f, 0.0f, 0.0f} |
Where the pose put the body last tick, world space; runtime, not serialized.
This tick's pose against it is the velocity a driven body hands the solver when the ragdoll takes over. posed is false until a pose has been applied since the bones were last handed to the solver.