Solver residual vs. average overlap for stacked spheres

Post Reply
przecze
Posts: 3
Joined: Mon Jun 17, 2019 12:15 pm

Solver residual vs. average overlap for stacked spheres

Post by przecze »

Hey, I'm wondering how to relate solver residual (the one accessed with solver.m_analyticsData.m_remainingLeastSquaresResidual) with expected average overlap of static objects.
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;
Is this the right approach?

I'm using

Code: Select all

btSequentialImpulseConstraintSolver
Post Reply