[ODE] Apparent bug in geom.cpp (v0.03)

Ruud van Gaal ruud at marketgraph.nl
Wed Jan 9 03:56:02 2002


Hi,

I've posted this twice, but never got a response, and I still think it's
wrong (and carried from v0.025 to v0.03):

There's probably a bug in geom.cpp's dCollideBP(). You normally define a
plane by normal*point+d=0 (where normal=plane->p[0..2]=(a,b,c) and
d=plane->p[3]), to get the usual ax+by+cz+d=0.
In dCollideBP(), the initial (biggest) penetration depth is calculated using
'plane->p[3]+...', while I think it should have been '-plane->p[3]', as the
whole expression is negated to get a positive depth (while the plane
equation would ofcourse generate a negative value once penetrated, but you
want 'depth' to turn out positive in that case).

Having changed that line (geom.cpp:856) to depth=-plane->p[3]..., my
software works again (after a lot of manual calculations to see if *I'm* not
the one doing negative calculations). You may want to take a look.

Thanks,
Ruud