[ODE] Box-mesh collision

Erwin de Vries erwin at vo.com
Mon Nov 25 14:52:01 2002


> Hi,
>
> I was (finally) looking at Erwin's box-mesh collision today, when I
noticed
> something weird :
>
>     float DistSq = ColTri.Plane.Normal.DotProduct(BoxCenter -
> *ColTri.Vertices[0]);
>     ColTri.ClosestPoint = BoxCenter - (ColTri.Plane.Normal *
ColTri.DistSq);
>
> Unless I'm missing something, the local variable DistSq is never used. On
> the other hand, ColTri.DistSq is used while probably not initialized. I
> guess the two lines should be :
>
>     ColTri.DistSq = ColTri.Plane.Normal.DotProduct(BoxCenter -
> *ColTri.Vertices[0]);
>     ColTri.ClosestPoint = BoxCenter - (ColTri.Plane.Normal *
ColTri.DistSq);
>
> ...unless, once again, I'm missing something. (I didn't trace it, I'm just
> browsing the CVS repository)

.... You're probably right. I cant quite see how this code is supposed to do
anything useful. But its been so long since i've written this code, that i
have doubts about the reason of existence of other stuff as well. :-)

> There's also another version from Nolan Walker, based on Magic. Is this
> better / more recent ? (the question might already have been asked, but I
> can't remember the answer...)

Yes it is better in some ways, but because of some bugs the end result is
something not too great. I STILL need to fix this. I'm using the code in my
projects and we're nearing the completion of it, so i would need to do it
sometime soon.

In case you want it. It is in the mail archives somewhere.

Erwin