Hello everyone,
I have the following ragdoll structure (green dots - bones, pinkish lines - bone links):
The black boxes are Bullet's rigid bodies (boxes) constructed by creating an AABB of all mesh vertices that are influenced by the bones in a particular, let's say, body part. So for example, if you look at the chest area, there are five bones that make up that body part - I take the vertices, calculate their AABB and construct a rigid body. (In the picture, the head is a circle, but in my code, it's actually a box, too :))
These rigid bodies are linked to each other using six-DOF constraints. The ragdoll itself is working fine, but now, when I run the simulation, I want to somehow map a rigid body's transformation to the corresponding bones to animate the mesh. To continue with the example of the chest area - whenever it is moved by Bullet, I want to apply its center of mass transform to all the bones that are within the chest area.
I was thinking of using a bone's world bind matrix and transforming it like so:
destMatrix = bodyCenterOfMassTransform * boneWorldBindMatrix
but it didn't quite cut the mustard.
Do you have any other ideas?
Thanks,
Patryk
I copied the question from StackExchange in hope of reaching a broader audience