BoudingShape for RagDoll demo

vagr
Posts: 13
Joined: Tue Mar 18, 2008 1:08 am

BoudingShape for RagDoll demo

Post by vagr »

Hi I am new to physics simulation.

I saw the ragdoll demo under Bullet engine and it is very interesting. However, after my changing the bounding shape from Capsule to Bounding Box, sometimes, I got the correct Ragdoll effect while some times one or two of characters may show some wired actions such as fly away.

I change the bounding box as following code: basically, capsule is along Y axis so my transformation is that

halfX = r
halfY = height / 2 + r
halfZ = r.

Could anyone tell me why I have to choose capsule (or convex mesh) and box is not correct?

Btw, could anyone recommend some papers or books for Ragdoll? I checked wiki but statement is too simple and just some terms there.

Thanks a lot in advance.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: BoudingShape for RagDoll demo

Post by Erwin Coumans »

It might be that the boxes/collision shapes inter-penetrate and that causes instability. Can you try to make the boxes smaller, or disable collisions between them?

Which constraints are you using for the ragdoll? We just fixed a constraint limit issue with the btGeneric6DofConstraint, that might help.
Btw, could anyone recommend some papers or books for Ragdoll? I checked wiki but statement is too simple and just some terms there.
I'm working on a book on real-time rigid body dynamics, and it will include more information on ragdolls. Do you have specific questions?

These are good reads on constraints and rigid body dynamics: Hope this helps,
Erwin
vagr
Posts: 13
Joined: Tue Mar 18, 2008 1:08 am

Re: BoudingShape for RagDoll demo

Post by vagr »

Hi Erwin,

Thanks a lot for your reply!
Erwin Coumans wrote:It might be that the boxes/collision shapes inter-penetrate and that causes instability. Can you try to make the boxes smaller, or disable collisions between them?
1. I tried to make boxes smaller, for example: halfExtents.setValue( radius * 0.5, (height / btScalar(2.0) + radius) * 0.5, radius * 0.5); but still very unstable. If I also tried to minus 0.02 and 0.025 for each halfExtent, still very unstable. And for 0.025, some part of body even disappears. And no ragdoll effect at all.
2. I disabled the collision when building the constraints, such as:
m_ownerWorld->addConstraint(m_joints[JOINT_PELVIS_SPINE], false);
// original one is
m_ownerWorld->addConstraint(m_joints[JOINT_PELVIS_SPINE], true);

The ragdoll effect is very stable now. While some other problems coming, the legs and arms will be spread on the floor.

Which constraints are you using for the ragdoll? We just fixed a constraint limit issue with the btGeneric6DofConstraint, that might help.


No. I did not use the btGeneric6DofConstraint. I just modified the standard RagDoll demo inside bullets with project name as appRagdollDemo. And there was no btGeneric6DofConstraint defined. Only btHingeConstraint and btConeTwistConstraint were defined inside.

I'm working on a book on real-time rigid body dynamics, and it will include more information on ragdolls. Do you have specific questions?

These are good reads on constraints and rigid body dynamics:

Hope this helps,
Erwin


I don't have any specific questions. I just hope to have some basic tutorial while I did not find much with google. I will try to access those materials. thanks a lot for sharing.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: BoudingShape for RagDoll demo

Post by Erwin Coumans »

vagr wrote:1. I tried to make boxes smaller, for example: halfExtents.setValue( radius * 0.5, (height / btScalar(2.0) + radius) * 0.5, radius * 0.5); but still very unstable. If I also tried to minus 0.02 and 0.025 for each halfExtent, still very unstable. And for 0.025, some part of body even disappears. And no ragdoll effect at all.

Try to avoid too small objects, sizes of objects should be larger then 0.2 units (try to keep units in meters) in any direction.
2. I disabled the collision when building the constraints, such as:
m_ownerWorld->addConstraint(m_joints[JOINT_PELVIS_SPINE], false);
// original one is
m_ownerWorld->addConstraint(m_joints[JOINT_PELVIS_SPINE], true);
The ragdoll effect is very stable now. While some other problems coming, the legs and arms will be spread on the floor.

Ah, good to hear your ragdoll simulation is more stable now. There is also a GenericJointDemo that shows ragdolls, but if your current ragdoll model is working fine just stick with that.

Thanks,
Erwin