[ODE] Merging multiple geoms into a single trimesh - a few issues

Geoff Carlton gcarlton at iinet.net.au
Thu Jan 13 11:51:37 MST 2005

Making the world a big trimesh seems ok.  But then, making interiors out 
of primitives seems ok too. :-)

After having a look at the trimesh codeI think that throwing in a bunch 
of mesheswill just work.  That is because there is no adjacency 
information stored in ode, and the normals aren't even used except in 
the trimesh-trimesh case.  Thus, having a soup of disjoint triangles is 
just as "correct" as a pefectly welded mesh.  In fact I think some basic 
adjacency info would be handy in the box-trimesh case at least - it 
can't tell that a triangle is part of a flat plane and so generates odd 
pointed normals from the unimportant edges (although it all seems to 
work out ok in the wash).

I also need triangle info, for sound generation.  While I haven't done 
anything about this yet, I think the best bet is to modify the dContact 
struct to add an int that can store the triangle index (for trimesh-* 
collisions only).  With a couple of quick changes, the colliders can 
then set that int, which the app can examine and do whatever with.  This 
is superior to the callback since the app knows which successful contact 
is associated with the triangle index - particularly important if the 
app discards contacts (e.g. via depth).  Its also a bit nicer than the 


More information about the ODE mailing list