Ragdoll body parts fall through ground

Post Reply
Tau
Posts: 25
Joined: Tue May 01, 2012 11:52 am

Ragdoll body parts fall through ground

Post by Tau »

Hello, I'm trying to add a ragdoll to my game. I'm using the Ragdoll demo as basis for this. The problem is that when my ragdoll falls from higher height some of its body parts fall through terrain and it gets stuck. I'm using btHeightfieldTerrainShape for terrain and btTriangleMesh for buildings and static objects. I understand that the problem is caused by small diameter ragdolls limbs.
I wanted to ask:
How to simulate small objects?
How to make sure that small objects don't fall through ground?

I know that one way would be to increase the simulation speed. Are there other ways?
User avatar
drleviathan
Posts: 849
Joined: Tue Sep 30, 2014 6:03 pm
Location: San Francisco

Re: Ragdoll body parts fall through ground

Post by drleviathan »

I believe these strategies would help:

Increasing the substeps per second (reducing substep duration).

Avoiding thin (terrain, mesh, various flat) shapes and instead only using convex shapes or btCompoundShape collections of convex shapes for all objects.

Enabling continuous collision detection (CCD) might help.
Tau
Posts: 25
Joined: Tue May 01, 2012 11:52 am

Re: Ragdoll body parts fall through ground

Post by Tau »

I didn't know what CCD was, I'm checking it out right now and i think i will go with that. Thanks.
User avatar
Octavius_Ace
Posts: 20
Joined: Sat Jun 04, 2016 10:34 pm
Location: Edinburgh

Re: Ragdoll body parts fall through ground

Post by Octavius_Ace »

I have a similar unresolved problem with any simple chain of rigid bodies and bad interpenetration with bhv tri meshes. CCD has not resolved the issues and I have to increase the sub-steps too high to be a practical solution in a game engine.
My assumption is that the non-solid nature of the tri mesh landscape is at least part of the problem.

I've posted here previously and have yet to resolve the issue in a robust and reliable way.
Also this problem has appeared on the forum a few times before and I've not seen a solution posted. (Other than use non-tri mesh solid static shapes)
I will eventually get round to looking into it further but it means understanding the low level narrow phase collision/response/constraint solver code in detail and in the absence of documentation, so it will be time consuming.

Please do post back if you resolve this to any degree.

Cheers.
User avatar
Octavius_Ace
Posts: 20
Joined: Sat Jun 04, 2016 10:34 pm
Location: Edinburgh

Re: Ragdoll body parts fall through ground

Post by Octavius_Ace »

For anyone searching for solutions to similar trimesh / ragdoll / constraint chain penetration problems, I was able to resolve my problems fully.
I've updated my original post with an explanation:
https://pybullet.org/Bullet/phpBB3/view ... =9&t=11481
Post Reply