My animated characters use a hierarchy skeletal system. Each limb has a rotational state, which is converted to a rendering matrix by multiplying it with its parents. I have easily figured out how to pose my ragdoll for physics start by determining their matrices using the character's rendering matrices. My ragdoll body parts are not in a hierarchy (which is part of what is confusing me).
Each ragdoll body part has a bind transform - a matrix that takes the body part from the zero-origin-point and places it at the limb location of the character. So when all ragdoll parts render with just their bind pose, it would look like a character in their bind pose. In order to place the ragdoll parts, I multiply each ragdoll part's bind pose with the character's rendering matrix for that bone. For instance:
Ragdoll_Leg->Transform = MUL( Ragdoll_Leg->Bind_Transform, Character->Leg->RenderMatrix );
This works, and the ragdoll starts exactly where my character is posed. However, I'm having a lot of confusion reversing this procedure and obtaining animated states for the character by using the ragdoll transforms.
My character's RenderMatrix for each bone is computed like this:
void KRaceBone::ComputeHierarchy(const MTX *states, MTX *finals, const MTX &derive)
{
finals[Index] = MUL( JointToOrigin, states[Index] );
finals[Index] = MUL( finals[Index], OriginToJoint );
finals[Index] = MUL( finals[Index], derive );
// Compute Children
for(int e=0; e<Bones.GetCount(); e++)
Bones[e].ComputeHierarchy( states, finals, finals[Index] );
}
Note the inclusion of the "states[Index]". That is the pure-rotational local state of each bone. That is what I'm trying to convert my ragdoll parts back into. Anyone have any advice? Anything at all is appreciated. I've been pretty lost at this.Thanks!
Edited by Kest, 10 May 2012 - 03:17 PM.






