[ODE] Pushing through collisions
Jon Watte
hplus-ode at mindcontrol.org
Thu Apr 29 11:55:33 MST 2004
Force is supposed to be exerted by the ODE contact constraints is
to be determined by the solver base on penetrate depth. So the
penetration depth is trivial, i.e collider's jobs.
Let me be more specific in my questioning: Exactly how big does the
solver make the forces, based on penetration depth and mass? Does it
also look at other values? (linear velocity, for example) Where in
the code can I look at this in detail? I've found the general area,
but haven't had the time to study the constraing solvers in detail,
and am looking for an accelerated start.
Also, my problem is not a temporary interpenetration, it's that by
pushing up against the block, I become more and more embedded into
the block; there's penetration all the time (I use ERP < 1).
Those problems are raised by not robust colliders. I think of the
the most "not robust" part of ODE is colliders.
It generates the collisions and depths just fine. Box/capsule is not
among the most complex colliders, and the code appears to do the right
thing (after I corrected for the denormal case :-)
(originated from Croteam's SE 2.0 engine). There is case in
cylinder vs sphere I have to exaggerate the depth value to make
the huge object didn't go through small one. Let's wait and see
That tells me that something else is wrong. You should not need to
exaggerate anything -- thus, I think it's the joint constraints that
are not correct, rather than the collider. Hence, my question about
how it's supposed to work.
> JW> Does ERP or CFM affect this, and if so, how?
> Yes!
> <From ode doc>
I already read the documentation, and I use an ERP of 0.9 (IIRC).
The question was whether ERP affects the constraint forces in any
way other than saying, "I'm D deep into this collision, and the
body is at mass M, and time step T, so I'll apply force that'll
accelerate the body ERP*D units in one time step". It sounds like
"no" is the answer.
Note that once you have penetration, if you correct that using an
impulse, you will have velocity going OUT of the object, so there
will always be some amount of bounce. I am under the impression
that ODE applies its corrections ONLY using impulses -- is that
correct?
Perhaps the answer is as simple as the slow squishing of the avatar
into the box is because of a poor CFM/ERP constant choice; I'll have
to go back and re-look at it (especially CFM). However, I'm still
interested in hearing about experiences in moving objects that
collide, rather than just applying force. I would imagine that if
you penetrate very far in a single time step, the force would be
such as to generate a pretty hefty speed going the other direction,
and thus actually generate "bounce" even if I didn't want it. Having
a rule that, for a contact, the object moved by (1-ERP)*depth and
had an impulse applied by ERP*depth is that I'm going to try next.
Cheers,
/ h+
More information about the ODE
mailing list