Problem transitioning from animation to physics ragdoll

Digitalghost
Posts: 25
Joined: Thu Dec 20, 2007 4:03 am

Problem transitioning from animation to physics ragdoll

Post by Digitalghost »

I implemented a system which can set the position and orientation of my physics ragdoll based on the location and rotation of the bones, and it seems to place the rigid bodies in the correct place relative to the bones.

The problem is that the poses in the mocap data violate the constraints of the physics ragdoll. For example, it's possible to have mocap data where the knee rotates or bends to the right or the left a bit, but I'm representing my knee in physics with a hinge constraint.

The end result is that after I turn on physics, the rigid bodies "snap into place". This creates forces and velocities which act on the rigid bodies and so instead of the ragdoll falling to a slump like I would expect, it spazzes out and flies through the air before landing.

Are there any suggestions on how to fix this? Is there some way I can solve all of the constraints without stepping through the physics simulation? Could I somehow run the constraint solver a few times and then zero out the velocities or something like that?

Any help would be appreciated, thanks!
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Problem transitioning from animation to physics ragdoll

Post by Erwin Coumans »

Digitalghost wrote:The end result is that after I turn on physics, the rigid bodies "snap into place". This creates forces and velocities which act on the rigid bodies and so instead of the ragdoll falling to a slump like I would expect, it spazzes out and flies through the air before landing.

Are there any suggestions on how to fix this? Is there some way I can solve all of the constraints without stepping through the physics simulation? Could I somehow run the constraint solver a few times and then zero out the velocities or something like that?
The position correction will add momemtum/velocity/energy indeed. We could add some position correction that doesn't add energy. I'll keep this request in mind, when we add solver/position stabilization improvements. If you are interested to look into this yourself, please check out the Box2D project, it includes such functionality. Erin Catto discussed some details here.

Thanks,
Erwin