[ODE] Trimesh preprocessing

Colin Bonstead colin at cyan.com
Tue Jun 8 12:00:12 MST 2004


Ok, I got something working so I thought I'd submit a patch for people 
to try out.

I added three public functions:

void dGeomTriMeshDataPreprocess(dTriMeshDataID g);
void dGeomTriMeshDataGetBuffer(dTriMeshDataID g, unsigned char** buf, 
int* bufLen);
void dGeomTriMeshDataSetBuffer(dTriMeshDataID g, unsigned char* buf);

Call preprocess on your trimesh data to mark all the edges and vertices 
that can be ignored.  If you want to save that data and reload it later 
(so you don't have to recalculate it at runtime), use the get and set 
buffer functions.  Currently, the data is only used in the 
trimesh-ccylinder collider.  There, I made it so the separating axis 
test only does axis tests against edges and verts that can't be ignored.

Unless you call the preprocess function, ODE should behave exactly the 
same with these changes.  I've tested it with some of our levels and it 
seems to work correctly.  I'd be interested to hear if it works ok for 
anyone else who wants to try it out.

Grab the patch here:
http://open.cyanworlds.com/ode_tri_pre.patch

Colin

-----Original Message-----
From: Colin Bonstead <colin at cyan.com>
Sent: Fri, 4 Jun 2004 14:13:53 -0700
To: <ode at q12.org>
Subject: [ODE] Trimesh preprocessing

Just so I don't overlap work with anyone, I though I'd mention that I'm
working on adding trimesh preprocessing, as detailed in the "Fast
Contact Reduction for Dynamics Simulation" of Game Programming Gems 4.
Basically it's just marking all the interior and concave edges as
ignorable (and their vertices).

It requires 6 extra bytes of memory for each triangle (I'm using 8 for
now to make it simpler).  It would be fairly easy to make it optional,
if some people don't want it.  I'm doing this for work, so it should
hopefully be done soon.  I'll submit a patch when I'm sure it's working
well.

Colin Bonstead
Cyan Worlds, Inc



_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode






More information about the ODE mailing list