[ODE] triangle collider surface

Erwin de Vries erwin at vo.com
Sat May 11 02:34:01 2002


> How do I create a surface for the triangle collider?  I've got the vertex
> data from Demeter, put it into (what I think is) the format that the
> tri-collide stuff expects, but my ODE bodies fall right through it.

Were you able to solve the linker errors? I've never seen them before.

> Right now my code basically does this:
>
> Call dCreateTriList to create the triangle list object,
> Build an array of dcVector3 objects
> Copy coordinates from Demeter's vertex array to the dcVector3 array
> Allocate an array of ints
> Initialize the ints with indices into the vertex array
> Call dGeomTriListBuild
> delete the arrays
> start the simulation

You should not delete the arrays. They are passed into the tricollider, and
it uses them. If you delete them its pretty 'unsafe'. In other words.. It is
very likely to crash.

> But, the body in the sim just falls through the terrain.  ODE is calling
> the collision callback, then I call dCollide, and dCollide says there were
> no contacts.  Am I skipping a step?

No.

> Also, from looking at the source, it appears to me that the callback
> functions passed into dCreateTriList() are optional, and collision
> detection should work without them.  Am I correct, or does the fact that
> I'm passing nulls for them explain the first problem? :-)

Yes they are optional. It works perfectly without them.

Erwin