[ODE] ODE Unstable Commit: Trimesh Preprocessing
Colin Bonstead
colin at cyan.com
Tue Mar 29 13:24:24 MST 2005
Ok, it took me about a half hour, but I finally did a commit to the ODE
unstable branch. For anyone else trying to do this, make sure you're
logged in via SSH, otherwise it won't let you commit.
Anyway, what I committed is a patch I did last year to add trimesh
preprocessing. I based it on the chapter "Fast Contact Reduction for
Dynamics Simulation" in Game Programming Gems 4. Basically it's just
marking all the interior and concave edges (and their vertices) as
ignorable. It requires an extra byte of memory for each triangle if you
use it. (If you don't call the preprocess function on your trimesh it
should function the same way as before, and not allocate any extra
memory.)
To use it, just call the function dGeomTriMeshDataPreprocess on your
trimesh. Once you've done that the data is cached and ready for use by
the colliders. Currently, only the ccylinder-trimesh collider uses the
data, since that's the only one I use. However, it should be fairly
easy to add it to any of the other colliders, if someone wants to do
that.
If you want to cache the preprocessed data so you don't have to compute
it every time you start your simulation, you can use the functions
dGeomTriMeshDataGetBuffer and dGeomTriMeshDataSetBuffer.
Colin Bonstead
Cyan Worlds, Inc
More information about the ODE
mailing list