Hi all,
i have two bodys at random orientation and a given rotation offset.
I want to calculate equal but opposite torques for both bodys to get: OrientationBodyA = OrientationBodyB * RotationOffset.
Following method works if both bodies have uniform inertias, like spheres or cubes:
1. Compute QuatA, which rotates OrientationA to match OrientationBodyB * RotationOffset.
2. Convert QuatA to AngularVeloictyA and then to TorqueA, introducing Inertia of BodyA.
3. Do the same like A->B for B->A, leading to: AngularVeloictyB = -AngularVeloictyA, TorqueB is calced with Bs Inertia.
Now i have two Torques with them i can move either A or B to fullfill the desired result, but i want to move both bodies.
4. Scale torques: TorqueA *= TorqueB.length / (TorqueA.length + TorqueB.length), and same opposite for B.
Now i have 2 Torques of equal length and opposite direction. Simulation is fine and correct.
But if Inertias are nonuniform, Torque directions are not opposite because nonuniform Inertia scale, and simulation becomes vibrant.
The shortest path of rotation is not the most easy to do, so in reality bodys would choose another path.
Tuning torque vector by hand i found that it's still possible to match offset by equal opposite torques,
but after days of research i still don't know how to calculate them...
Thanks for any help!
Equal + opposite torques to match rotation offset
-
- Posts: 2
- Joined: Fri Feb 11, 2011 9:37 pm