[ODE] Bug in Sphere Trimesh collider?

Mohsin Hasan mohsin.hasan at trivor.com
Mon Feb 14 16:50:57 MST 2005


Hi,

We are trying to integrate ODE in our engine and as a first step trying to
use ODE for doing level collision detection through Trimesh. Our level
geometry is BSP and we have loaded it into ODE through the trimesh
interface. We have started prototyping the collision of different primitives
with level geometry. These include box and spheres so far. Boxes seem to be
colliding just fine but we are having few issues with spheres. Whenever a
sphere reaches towards a wall after rolling on the ground and as soon as it
touches the wall, we get an assertion saying "Vector has zero size ..". We
traced the error in the code and it seems the error is due to the Trimesh -
Sphere collider returning incorrect triangles as touched primitives. For
instance we are getting triangles with vertices like 

V0 = -5, -432.x, 0
V1 = -5, -636.x, 0
V2 = -5, -572.x, 0

These vertices are used to create two vectors which in turn are used to
create a plane in the function GetContactData(.). As the vectors formed by
the above triangles are always parallel, we get their cross product to be a
null vector which gives the assertion during the Normalization phase. 

Long story short, has anyone else also had such an issue? And if so, what
was the solution for this. Is the trimesh - sphere collider robust? Or does
it have these occasional issues?	

Thanks,
Mohsin




More information about the ODE mailing list