- Home /
Understanding how torque is applied
Unity has the `Rigidbody.AddTorque` method; there's a few things I don't understand about how this method works.
First of all, the reference says that the resulting rotation will be around the "torque axis". Where is this torque axis specified?
Secondly, very important to torque is where is the force applied relative to the axis of rotation: T = Fr
, where F
is the force you apply and r
the distance from the point of rotation. Where is this force applied in Unity?
Answer by Eric5h5 · Jun 30, 2012 at 06:20 PM
As the docs say, the torque axis, torque referring to the parameter in AddForce (torque : Vector3, mode : ForceMode = ForceMode.Force).
So the torque
parameter is used to specify both the axis and the force?
And where is it applied? (How far from the axis?) In other words, how can I deter$$anonymous$$e the angular momentum it will produce?
Torque IS the result of applying a force at a lever/distance!
If you want to apply a certain FORCE at a certain distance to create a TORQUE then use Rigidbody.AddForceAtPosition
(the result of applying a torque depends on the diameter of the collider, the mass and the angular drag)
Answer by I9ball · Sep 06, 2012 at 08:17 AM
Essentially,
rigidbody.AddTorque( 5, 0, 10);
applies angular torque with a magnitude of 5 around the X axis. (A positive value rolls a sphere forward. Negative value... backwards)
No torque applied to the object around the Y axis
Magnitude of 10 around the Z axis. (Positive value rolls sphere left. Negative value, right.)
All 3 values combine resulting in force applied along an angular plane or Vector 3 direction
The angular momentum produced by the torque pretty much depends on the physic material properties assigned to the objects.
The angular velocity of an object i believe can be found using:
myObjectSpinRate = rigidbody.angularVelocity.magnitude;
Hope this helps :)