[ODE] Slipch -> Aceeleration of angular velocity

slipch slipch <slipch at gsc-game.kiev.ua>
Mon Feb 24 03:39:01 2003


Hello Ivan,

Monday, February 24, 2003, 10:30:13 AM, you wrote:

IB> It compiles now. DLL problem it was. But how to use it? Which are in and which out parameters. Say, If I put 1000 Nm on X axis, what will acceleraon of angular velocity around this axis be?



IB> Hi! Me again.
IB> Function wont compile.
IB> What to do?

IB> bye,ivan

>> void dBodyAngAccelFromTorqu(const dBodyID body, dReal* ang_accel, const
IB> dReal* torque){
>>       dMass m;
>>       dMatrix3 invI;
>>       dBodyGetMass(body,&m);
>>       dInvertPDMatrix (m.I, invI, 3);
>>       dMULTIPLY1_333(ang_accel,invI, torque);
>>       }

It seems this is not completely right. It would be right if m.I was in
global coordinates, but it is in local body coordinates indeed. You
have to convert invI or m.I to global coordinates
R=dBodyGetRotation(body);
dMULTIPLY2_333(invI1,invI,R);
dMULTIPLY1_333(local_invI,R,invI1);

Pass torque as
dVector3 torqu={1000,0,0};
and get  ang_accel as three reals.

I have not ever use it and never check it.
So there is no warranty that is right.




-- 
Best regards,
 slipch                            mailto:slipch@gsc-game.kiev.ua