Cant find how to use InertiaTensor
For a special purpose I need to replicate rb.AddTorque(ForceMode.Acceleration) by converting it to rb.AddForceAtPosition(ForceMode.Force).
So what I do is for each axis I apply a force at one meter distance, multiplied by the corresponding inertiaTensor axis. So for example for applying a torque of 1 N.m on the z world axis of my object :
With Torque method : (without mass account for torque, then mass account)
rb.AddTorque(Vector3.forward, ForceMode.Acceleration);
Then with Force method :
rb.AddForceAtPosition(Vector3.up * rb.inertiaTensor.z, rb.worldCenterOfMass + Vector3.right, ForceMode.Force);
And this gives me the same result, all is ok for now.
But this work only on One Axis, when the object is only rotating on the this axis we work on.
The problem is I can't figure how to correctly use the InertiaTensor to get the correct moment of inertia to multiply the force by. My math background Is poor, but Im sure there is some small trick to get this working.
The finality of this weird move is I need to rotate a physic object by by accelerating its angular velocity without account of its mass, to get the rotation behaviour I want. Then re-use this exact same force to another object but this time with mass account of the second object.
Help is welcome.
Your answer
Follow this Question
Related Questions
Hovercar rigidbody acceleration 1 Answer
How to apply a force at certain point of an object? 0 Answers
How do I use the growth (increasing scale) of an object to apply force? 0 Answers
Isolating physics of item attached to a moving rigid body 1 Answer
Stopping object with ConstantForce,Stopping Constant Force 0 Answers