Now that I have been pointed out that if you change your simulation timestep to something small (1/240,1/1000 etc.), you probably need to adjust the ERP and CFM to get non-exploding simulations.
So I wanted to do that:
ERP
Error Reduction Parameter, [0;1], The ERP specifies what proportion of the joint error will be fixed during the next simulation step.
From what I think, it should be lower for smaller timesteps, right?
However the ODE documentation (I was pointed to that a lot, http://www.ode.org/ode-latest-userguide.html#sec_3_8_2) says, the calculation is the following:
Code: Select all
yourERP = timeStep * kSpring / (timeStep * kSpring + kDamper)
Edit: This is wrong, ERP is dependent on the timestep and the timestep is measured as T =1/f where f is the frequency of your update [second^-1].
CFM
Constraint Force Mixing, [0;infty], A nonzero (positive) value of CFM allows the original constraint equation to be violated by an amount proportional to CFM times the restoring force \lambda that is needed to enforce the constraint.
From what I think, this should be higher if you want to get the simulation away from singularities
However the ODE documentation (http://www.ode.org/ode-latest-userguide.html#sec_3_8_2) says, the calculation is the following:
Code: Select all
yourCFM = btScalar(1) / (timeStep * kSpring + kDamper)
What am I getting wrong here?