Hi all,
I'm working on ragdoll physics in C++ and got it finally working. Simple ragdoll models with cone twist and limited hinge constraints are working perfectly, so I tried more complex ragdolls.
As soon as I try models where collision shapes are overlapping or ragdolls where some part may not contact the ground, I got strange behavior. The model jitters and does not stop to move. Sometimes the model starts to rotate and even is lifted from the ground.
I tried to deactivate all collision within a ragdoll, but the jitter from parts that cannot contact the ground remains.
So here are my questions:
1) Is there a possibility to stop this jittering? Should I adapt parameters like friction, damping or other that I don't know yet?
2) What is a simple way to test which collision shapes contact each other at the start to deactivate the collision between them?
3) Should I use the btMultiBody class?
Ragdoll C++
-
- Posts: 5
- Joined: Sat Nov 19, 2016 9:47 am
Re: Ragdoll C++
Sounds like you have link<->link collisions, try looking, e.g.
If it was me I'd have used btMultiBody, no cone twist joint though (last I checked)
Code: Select all
int numManifolds = dispatcher->getNumManifolds();
for (int i = 0; i < numManifolds; i++)
{
btPersistentManifold* manifold = dispatcher->getManifoldByIndexInternal(i);
int numContacts = manifold->getNumContacts();
if(numContacts > 0)
{
// see if manifold->getBody0() and manifold->getBody1() is
// link<->link or link<->ground plane?
}