[ODE] Scenery collision
Jon Watte
hplus-ode at mindcontrol.org
Thu Dec 23 08:36:58 MST 2004
Why not create large tri-mesh data? The whole point of the trimesh
support in ODE is that it uses a very highly optimized bounding
hierarchy for triangle meshes, so you don't have to do that in your
app. You can still use the same vertex data as in your app -- ODE
does not copy the vertex data.
Or, to put it in other words: How do you know which triangles to
pass back to the collision system when it asks for them? OPCODE
(used by ODE) already implements a very space- and cpu-efficient
method of doing that, and it's unlikely that you can beat it by
significant margins.
If you page your world data in from disk, I would also page in
the collision trimeshes in the same way. Here, ODE has a design
problem: it takes a while to generate the trimesh, so doing it at
runtime is a problem. Meanwhile, there's no good way of storing the
generated trimesh data for quick loading.
Cheers,
/ h+
-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of
Rafael Horbach
Sent: Thursday, December 23, 2004 6:45 AM
To: ODE at q12.org
Subject: [ODE] Scenery collision
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
_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode
More information about the ODE
mailing list