I am currently trying to make a Ragdoll and it falls to the ground obeying constraints as expected but it never actually comes to rest. The rigid bodies appear to vibrate and the Ragdoll starts moving around with back-flips and such. I searched for the solution to this problem a lot, and found out that many people have had this problem, yet I couldn`t find a solution. I started tweaking in some values in the code given below:
Code: Select all
m_bodies[i]->setDamping(0.05, 0.85);
m_bodies[i]->setDeactivationTime(3.0);
m_bodies[i]->setSleepingThresholds(5.4, 5.6);
m_bodies[i]->setContactProcessingThreshold(0.25f);
m_bodies[i]->setCcdMotionThreshold(0.05f);
m_bodies[i]->setCcdSweptSphereRadius(0.06f);
To be honest, I don`t still know what some of these functions do. I changed the arguments of setSleepingThresholds(linear, angular), which for some given value seems to put the body to rest. I guessed that the body will be put to sleep if the current values exceed the threshold values. However, when I get the threshold values for any time, all of them are 1(constant). They don`t actually change at all, then what`s the point in setting up a threshold. So, I need to find what the parameters are and what the function does. Also, if there is solution or optimization to the problem of Ragdoll that I explained earlier, please share.