[ODE] A question about multiple geoms for one body

Bram Stolk bram at sara.nl
Wed Feb 28 12:51:01 MST 2007


Shamyl Zakariya wrote:

> 1) If it's really as easy as people on the mailing list describe it,  
> can I really just add multiple geoms to one body? So, can I just call  
> dGeomSetBody on multiple geoms to a single body?

Yes.
If either geometry collides with the world,
the collision response affects the same body.

> 2) How do I represent the geom's local transformation relative to the  
> body? Is this where dGeomTransform comes in? Or is it a separate  
> mechanism?
> 

Two options:

(A) dGeomSetOffsetPosition()

(B) dCreateGeomTransform()
     You create a transform-geometry, and attach the body to that.
     You associate the underlying geom with dGeomTransformSetGeom()

(B) is the traditional method, but the newer (A) method is
often easier to use, and simpler to implement.

> 3) Once this is done, and the simulation is running, I obviously  
> can't just call dBodyGetPosition or dBodyGetRotation; I'll have to  
> get the geom's local position/rotation and combine that with the  
> body's position and rotation. Is there an automatic way to do this?  
> Will calling dGeomGetPosition and dGeomGetRotation have this taken  
> care of already?

You can still call dBodyGetPosition.
It will properly report back the position of the centre of mass.

For drawing purposes, take a look at boxstack, in the branch
"else if (type == dGeomTransformClass)"
It multiplies the orientations of the trfgeom and underlying geom.


   Bram


> Thanks,
> 
> Shamyl Zakariya
> 	"there is no emoticon, for what I am feeling"
> 
> 
> 
> _______________________________________________
> ODE mailing list
> ODE at ode.org
> http://mooshika.org/mailman/listinfo/ode



More information about the ODE mailing list