Page 1 of 1

Solver residual vs. average overlap for stacked spheres

Posted: Sat Jan 02, 2021 5:47 pm
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