Let's say I have a simulation with a big stack of spheres. I don't want them to overlap more than 10% of the sphere radius. I noticed Residual scales linearly with the number of spheres and quadratically with the length unit. So I set my threshold like this:
Code: Select all
m_dynamicsWorld.getSolverInfo().m_leastSquaresResidualThreshold = std::pow(sphere_r*0.1, 2)*spheres_count;
I'm using
Code: Select all
btSequentialImpulseConstraintSolver