[ODE] freeing trimesh memory

Jon Watte hplus-ode at mindcontrol.org
Wed Mar 30 12:07:11 MST 2005


> I think the intent here is to not have ODE step on the vertex list, face
> list and normals your provide to generate the trimesh data; in other
> words, not manage deletion. It's up to the user to delete these. Either
> that or it's just been overlooked and not implemented yet. The TriMesh is
> not considered to be as far along in development as the other geoms, so
> this behavior could change in the future.

Trimesh has been around for a long time by now. It should work fine with 
all the standard usage.

The TriMeshData object should be destroyed, and does the right thing when 
you do it -- the destructor doesn't need to do anything.

The specific design of the trimesh data is that YOU manage the vertex and 
index data; ODE will not assume that you allocated it with any particular 
memory allocator (or even that it's in a block on its own -- it could be 
shared with other vertex buffers in your management). Thus, you need to 
separately do whatever you need to do to unload the vertex data after you 
shut down everything. The reason for this is of course to make it possible 
to share vertex data between rendering, AI and physics without duplication.

Cheers,

			/ h+




More information about the ODE mailing list