From: Chris B. <chr...@gm...> - 2007-05-01 08:38:02
|
On 01/05/07, Ethan Glasser-Camp <gl...@cs...> wrote: > To quote Chris Bainbridge, who once answered a similar plea for help > from me: > > "Your CFM value is too high, which allows the generated contacts to be > violated significantly. Try world.setCFM(1E-8)" > > Indeed, I put that line > > world.setCFM(1e-8) > > at line 107 of your program, and everything seems to work more as > you'd expect. I don't really understand this part of ODE too well, > maybe someone else can explain better what's happening. Specifically, > is it true that for any given CFM, you can increase the mass of your > objects, and get more sponginess in your collisions? What gives? Pretty much, yes. CFM just scales the force that would be applied to correct the error from a constraint. Suppose you need a force of 10N to totally correct a constraint in a single simulation step, and CFM is 0.5, then the simulator will actually apply a 5N force in that time step. Hence the error due to the constraint will be slowly corrected over several time steps, rather than in a single time step. Your observation about mass being related to sponginess is correct. Imagine two objects with mass colliding. The larger the mass, the larger the force required to correct the collision and stop the objects from penetrating. Since you only apply a proportion of this force in a single step you'll see more more overlap of the two objects as the mass increases because there is more uncorrected force in total. Hmm. Imagine being hit in the face with an iron bar - you'd expect it to penetrate further than a plastic bar. Now imagine the collision constraint like a very thin/weak force field around your head that pushes objects away. It couldn't stop the lead bar from being swung straight through your skull, but probably could stop the plastic one! ;-) See http://ode.org/ode-latest-userguide.html#sec_3_8_0 for a more detailed explanation. |