[ODE] Dynamic trimesh's

Cristian Bianchi cris at cris.hspace.name
Tue Nov 15 02:00:18 MST 2005


Hi,
i had the same problem... I needed to deform trimesh vertices and have the
collision data updated to collide with the new configuration of triangles. 
I discovered in OPCODE the capability of efficiently update the internal
structures without rebuilding them. The method name is "Refit". I added a
function to the ode interface, to be able to call the update routine, the
dxTriMeshData::UpdateData. You must simply call the dGeomTriMeshDataUpdate
on your trimesh object, after you modified the vertices. I tested it on a
big triangle mesh (about 20.000 triangles) and it works quite well.
Here's the code:

void dGeomTriMeshDataUpdate(dTriMeshDataID g) {
    dUASSERT(g, "argument not trimesh data");
	g->UpdateData();
}


void dxTriMeshData::UpdateData()
{
	BVTree.Refit();
}

Regards,
Cristian Bianchi
Lead Developer - Simulation Software Division
Rome - Italy.


-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org] On Behalf Of Jon
Watte (ODE)
Sent: martedì 15 novembre 2005 3.05
To: Brad
Cc: ode at q12.org
Subject: Re: [ODE] Dynamic trimesh's


> having trouble getting ODE to cooperate, though. When I don't touch 
> anything, except adjust the verticies that I originally gave ODE to 
> generate the trimesh from, wierd things happen. Sometimes I can walk 

> What's the proper way for updating a trimesh geom? Do I have to delete 
> the old geom and create a brand new geom?

You have to create a new TriMeshData object, because that object 
actually pre-calculates an AABB tree of the entire trimesh you give to 
it. If you change the vertices without changing the tree, you're going 
to see bad behavior.

Cheers,

			/ h+

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






More information about the ODE mailing list