Armature bone orientations from physics joints

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
NetSavant
Posts: 28
Joined: Wed Apr 20, 2011 10:50 pm

Armature bone orientations from physics joints

Post by NetSavant »

Hey Norbo / all,

I'm in the process of trying to rig up a ragdoll to an xbox live avatar - my plan was to manipulate the orientations of particular bones in the avatar's bind pose to match the orientations of joints that are modeled in the ragdoll (which won't be all of them - not gonna bother with fingers, etc.).

I'm creating the ragdoll entities and joints to match the bind pose - but I kinda hit the limits of my knowledge with how to extract the right orientations from those. For example the shoulders are a couple of BallSocketJoints - I can see there's a GetAngularJacobian() method that probably has the info I want in some form, but I get the feeling from initial web searches that I might need a lot of linear algebra studying before I understand what a Jacobian is.

So I thought I'd be lazy and ask here first - is there an easy way to extract an orientation matrix or quaternion to transform, say, an upper arm from its initial bind pose orientation to its current orientation?

Thanks!

-Luke
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Armature bone orientations from physics joints

Post by Norbo »

The constraints can be ignored when trying to compute the relative orientations. For reference, the GetAngularJacobian actually defines part of how the constraint computes relative velocities and transforms solution multipliers into impulses; it isn't necessarily helpful for determining the relative orientation.

Instead, I would just maintain a hierarchy of the entity 'bones.' Compare the relative orientation between the parent and child entities in the bind pose against the relative orientation between the parent and child entities in world space. The transformation between the two would be the goal. For quaternions, this can be obtained by conjugating one orientation and multiplying it against the other.
NetSavant
Posts: 28
Joined: Wed Apr 20, 2011 10:50 pm

Re: Armature bone orientations from physics joints

Post by NetSavant »

Thanks Norbo - had that thought a bit after I posted, to use the world-space orientations of the parts relative to each other - that worked good.
Post Reply