AddLocalForce vs Torque

nikhil

01-03-2007 11:55:57

Hi

The addLocalForce takes two parameters -
The Force
The Position

I wanted to know what are they relative to? The node's position or relative to the 'Center of Mass'??

IMO - addTorque doesn't makes much sense, addLocalForce does a better job at simulating Torque with a Distance * Force. I've tried using addTorque never was satisfied with results or maybe I just suck at it.


Regards

Nikhil

nikhil

01-03-2007 12:39:07

Tht said. I want a SETLOCALFORCE function plz...

walaber

02-03-2007 15:30:25

those should be relative to the "origin" (node position) of the body, not the COM, although often they are the same.

addTorque most definately works, because addLocalForce just uses the addTorque function internally.

nikhil

03-03-2007 10:20:35

those should be relative to the "origin" (node position) of the body, not the COM, although often they are the same.

addTorque most definately works, because addLocalForce just uses the addTorque function internally.


It's just that torque is a cross product of two vectors and defining it in that way is more flexible and intuitive for me. More Importantly, I wanted to ask you. I'm doing a addLocalForce to turn my player. The problem is whn I let go of the turn key the player continues to turn, which though is in accord with Physics but is not a desirable behaviour. I want more of a steering behaviour where you are turning as long as the button is pressed. As soon as you let go of the button you just keep heading straight-off in the new direction.

Currently, I'm doing a

Vector3 omega = robotBody->getOmega();
robotBody->setOmega(Vector3(omega.x,0,omega.z));

to prevent further yawing. Is there a more elegant (physics friendly) way of doing this??

Regards

Nikhil

Vectrex

03-03-2007 12:27:18

just take the omega and apply an opposite torque until it's near 0 when you aren't steering

nikhil

04-03-2007 06:26:29

just take the omega and apply an opposite torque until it's near 0 when you aren't steering

How much torque should I apply? is there some formula I can use to determine the amount of torque?