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

Ruud van Gaal ruud at marketgraph.nl
Thu Jan 10 04:57:02 2002


> > 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.
> 
> well okay, but in ODE i define a plane as:
>   p[0]*x + p[1]*y + p[2]*z = p[3]
> not as
>   p[0]*x + p[1]*y + p[2]*z + p[3] = 0
> so you see the sign on p[3] is reversed. confusing huh?

Yes. :) I guess using p[3] this way is the same type of situation as using
left- vs righthanded coordinate systems. :(

> i not sure why
> you've needed to change dCollideBP() to make it work

I create temporary planes to collide with from my internal plane classes,
which use ax+by+cz+d=0. So I passed these parameters (abcd) directly to
dCreatePlane(). So I have to change the last param into '-plane.d' instead
of 'plane.d' (where 'plane' is my own class) and it should all work with the
original ODE source in this case again.

Thanks for explaining that. Perhaps a small list of 'Common pitfalls' might
be handy; this negation, the OpenGL matrix storage (which is transposed,
hence the transpose from ODE->OGL). It sometimes takes a lot of time to
figure out, so a list of pitfalls might help newcomers.

Cheers,
Ruud