addTorque and addForce - How to do this?

Dirso

29-09-2007 15:54:26

Hi,

I need to apply a friction force F1(Fx1,Fy1,Fz1) to the point P1(Px1,Py1,Pz1) of a body "me". I don't think I can use addLocalForce, since F1 depends on the body velocity vector and orientation relatively to the world.
I'm doing something like this:
me->addTorque(F1, P1 - CenterOfMass);
me->addForce(F1);

Am I right?

Thanks,
Dirso.

BTW:
1) P1 is in local coordinates (relatively to the body origin)
2) CenterOfMass = me->CenterOfMass + InicialCenterOfMass

Game_Ender

29-09-2007 20:49:59

If you want to apply a force in the local coordinate space, apply it with "addLocalForce". How exactly if F1 calculated where this will be a problem?

Dirso

30-09-2007 00:03:09

Because it looks like that if the orientation of the body has changed since the game started, the Force is multiplied by the body's orientation;