[ODE] triangle collider surface

Nate W coding at natew.com
Mon May 13 02:43:02 2002


On Sun, 12 May 2002, Erwin de Vries wrote:

> > Boxes bounce off the terrain as expected, but spheres seem to behave
> > as if the surface was inverted.
>
> More people had this problem. I'm not quite sure why it happens, but it
> appears to come from the class initialisation order. Try to create a trilist
> before you create your first sphere, and the other way around, and see what
> happens. I think this solves the problem. If anyone could point out WHY this
> happens... I have no clue.

I had the same results with either order.  But, this fixed it:

Line 554 of dcTriListCollider.cpp, add a unary "-" operator:

((dcVector3&)OutContact.normal) = -OutNormal;

I suspect that Marc O'M is probably correct about a reversed cross-product
somewhere.  I kinda doubt this is the 'right' place to make the change,
but it's working for me.  I'm not sure how it fits with the initialization
order, though.  Maybe there's something else going on as well.

-- 

Nate Waddoups
Redmond WA USA
http://www.natew.com