sebastieng
26-04-2006 03:21:42
I was wondering how to rotate my character by using forces instead of using orientation. I have the desired angle by calculating the movement of the mouse but i dont know wich formula to apply to perform the rotation. Please could you give me some information how to do that, not only code. I want to understand the concept
OvermindDL1
26-04-2006 07:30:42
I am not sure if this is supposed to be how you should do it, but I do it as this:
I have a local point designated the rotation point, usually something like Vector3 turnPos(0.0f, 0.0f, 2.0f);.
I calculate the force based on the input events, and set it as a Vector3 turnAmt();
I then apply local force like: me->addLocalForce(turnAmt, turnPos);
sebastieng
26-04-2006 14:58:04
I want to apply torque to rotate my character around the Y axis just like the command yaw does. The problem is i dont know how to apply force to rotate my character and then stop it, just like when i do yaw(angle).
praetor
26-04-2006 16:18:02
If you can at all help it don't use torque directly. A year later you'll still be banging your head on your desk.
OvermindDL1
26-04-2006 18:03:24
Yea, never use torque. As stated, I just apply an x force to an offset behind the thing in local space to rotate it. You can apply an opposite force to stop it, although I have damping at 40 as I recall and that makes it stop rotating automatically rather quickly anyway.