[ODE] box-box performance
Gary R. Van Sickle
g.r.vansickle at worldnet.att.net
Tue Nov 26 23:53:02 2002
> I have implemented this sort of thing on top of ODE. My bodies come to
> rest if their velocities went under a certain length. But be careful,
> there are situation where for example a box can stay on an edge. To
> avoid this you have to take time in concideration.
Instead of time, could this take "stability" into account instead?
e.g. something like this:
if(
(body.KineticEnergy() < epsilon) // i.e. velocity ~= 0
&& (body.PotentialEnergyRelativeTo(body_it_is_contacting) < epsilon)
// i.e. it isn't going to change on us on its own.
)
{
// "Freeze" body until something hits it etc.
// ...
}
Seems to me that this would be pretty much foolproof, and better yet
instantaneously-acting; there'd be no need to wait until you were reasonably
sure the body had "really" stopped moving, you could lock the body down as soon
as these conditions became true and know you were doing the right thing. Or is
there a conceptual or implementational issue here I'm missing?
--
Gary R. Van Sickle
Brewer. Patriot.