[ODE] freeing trimesh memory
Chris Ledwith
cledwith at d-a-s.com
Wed Mar 30 12:43:11 MST 2005
> Hi all,
>
> I've googled q12.org and wasn't able to find a good answer.
>
> When I do dWorldDestroy does it free the memory that was allocated and
> passed to dGeomTriMeshDataBuildSingle? Or, should I keep pointers
> around and free/delete it manually at the end?
>
If you take a look at the source for dWorldDestroy, you'll notice that it
acts only on bodies and joints. If you want to destroy all geoms in a
space, call dSpaceDestroy with cleanup mode 1 (this is the default mode --
see docs for further info), which will cause dSpaceDestroy to call
dGeomDestroy on each geom in its list.
TriMesh is a special case. You cannot simply call dGeomDestroy, you
(technically) should also call dGeomTriMeshDataDestroy. Unfortunately this
function doesn't seem to actually do anything as of yet -- because the
dxTriMesh destructor has no code.
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.
-C
> Thanks,
>
> Dacheng Tang
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>
More information about the ODE
mailing list