I'm having a little trouble getting something to work, I need to turn an object on it's axis to match another (match it orientation, not point towards it)... trouble is I cant use standard look functions as I'm turning it with physics so I need to get an accurate reading on the amount of degrees clockwise or anticlockwise until the objects are aligned.
I have had some success simply comparing the rotation of each object, but the trouble occurs when the two objects fall either side of zero degrees.
Is there a better "get" function than just trying to calculate from world rotations? Ideally I'd like a function that just gets the relative angle of the same axis on each object, with a positive value if the other object's axis is within 180 degrees clockwise and a negative if the axis is within 180 anticlockwise.
This is so I can apply a physics torque to rotate to match the object using the shortest route.