[ODE] Scenery collision

Rafael Horbach rafael at southlogic.com
Thu Dec 23 11:45:11 MST 2004


I had a problem when migrating from Tokamak to ODE that I've discussed 
on the ODE web forum. Just wanted to share with the mailing list and 
maybe get some opinions, so here it goes...

In Tokamak, we have a collision callback that asks the application for 
triangles inside an area. Using this we make a query of triangles in the 
scenery, using our engine (plus an extra gap to avoid new queries), and 
feeding the physics engine with these triangles.

My problem in ODE was that it doesn't ask for triangles before making 
the collisions, and I just would not provide all the scenery as a 
trimesh (we have some big locations, indoor and outdoor). I found a 
triangle callback, but as I saw, it just provides information about the 
collision, so it was not what I wanted.

My solution was to have a trimesh object linked with each "dynamic 
entity" in the world, in a separated ODE space, recreated only when 
needed (application explicitly invalidating an area or the object moving 
from the cached area) and then calling the ode collision function for 
this "dynamic entity" dBody parts and this trimesh.

Has anyone a better solution? Comments? Thanks!

__________________________________________
Rafael Horbach (rafael at southlogic.com)
Southlogic Studios
http://www.southlogic.com



More information about the ODE mailing list