[ODE] dMassTranslate

Geoff Carlton gcarlton at iinet.net.au
Wed May 31 17:49:05 MST 2006


Hi,
I don't think dMassTranslate has ever allowed the centre of mass to move 
around from a body, despite its name.

If you are using the RC, an alternative to the dGeomTransform is simply 
to set the offsets directly:

  geom = dCreateBox(0, 1.0f, 2.0f, 3.0f);
  body = dBodyCreate(world);
  dGeomSetBody(geom, body);
  dGeomSetOffsetPosition(geom, 100.0f, 0.0f, 0.0f);
  // now body is at 0,0,0 and geom at 100,0,0
  // either call dBodySetPosition(body, -100.0f, 0.0f, 0.0f);
  // or else call dGeomSetPosition(geom, 0.0f, 0.0f, 0.0f);
  // now body is at -100,0,0 and geom at 0,0,0

Geoff

Bram Stolk wrote:
> Mauro G. Todeschini wrote:
>   
>> Hi,
>> 	I've tryed to use dMassTranslate to translate the mass of a cylinder
>> but my body doesn't react in the expected way.
>> I thought that if I have a body in 0,0,0 (es. a cylinder with the axis
>> parallel to world x axis, ad the relative geom), and I dMassTranslate
>> Its mass to (-100, 0, 0) it should react as if I had a cylinder in
>> (-100, 0, 0) World coordinates and I attached a transformed geometry at
>> (0,0,0) world coordinates (whis react as expected).
>> Ok, I was not that clear but I hope you understand :)
>> Perhaps dMassTranslate is buggy?
>> I'm using a version of ODE I downloaded from CVS about 3 menth ago.
>> Perhaps now It has been fixed?
>>     
>
> for what it's worth... I couldnt get it to work properly either.
> (recent svn tree).
>
> Either we're both incompetent, or there's a bug :-)
>
> My sim behaved like the mass was not translated at all.
>
>    bram
>
>
>   
>> Bye and Thanks
>> _______________________________________________
>> ODE mailing list
>> ODE at q12.org
>> http://q12.org/mailman/listinfo/ode
>>     
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>
>
>   


More information about the ODE mailing list