[ODE] Difference Between Bodies and Geoms

Chris Ledwith cledwith at d-a-s.com
Sat Apr 10 13:18:39 MST 2004


>> I'm wondering if I need a seperate Geom for every object in the ODE
>> simulation. This would be rather memory expensive especially since I
>> plan to use TriMeshes. I'd like to be able to re-use a geom, like have
>> several objects(bodies) with the geom.
>
> When you create the trimesh geom it doesn't copy the vertex/index data you
> pass to it, so there's nothing that prevents you from reusing the same
> data
> for multiple trimesh geoms (you only need one copy of that data).
>

Not only that, the AABB tree is shared as well.

>> The reason I think this is because dGeomSetBody attaches a geom to a
>> body, not the other way around. If I'm right that I'll need to have a
>> seperate geom for _every_ object in my simulation, that's just a waste
>> and I wonder if that can be changed?
>
> Yes you do need a separate geom for every body because once a geom is
> attached to a body, moving the geom will move the body and vice versa.
>

Realize though, that with the geometry transform you can move geoms around
in object space and keep the body in the same place. See sections 10.7.8
and 10.9 of the user guide.
A single body can have multiple geoms so that you can represent portions
of an 'object' with different collision representations - box, sphere,
trimesh, etc.

-Chris



More information about the ODE mailing list