Rotation issue with setRotation/Transform
by Jamie Zephyr · in Torque Game Engine · 03/05/2009 (4:34 pm) · 2 replies
My issue is that when I use, for example, either of these:
setRotation(0 0 1 45); //-> 45* Set rotate
setTransform(0 0 0 0 0 1 45); //-> 45* Set rotate & Set position @ origin
They both end up setting the rotation = to: 0 0 1 58.3101
Why is torque doing this rather than rotating it to exactly the angle I want?
You can even see this by setting an objects rotate or transform through the console by the same method.
Thanks for any help I can get!
setRotation(0 0 1 45); //-> 45* Set rotate
setTransform(0 0 0 0 0 1 45); //-> 45* Set rotate & Set position @ origin
They both end up setting the rotation = to: 0 0 1 58.3101
Why is torque doing this rather than rotating it to exactly the angle I want?
You can even see this by setting an objects rotate or transform through the console by the same method.
Thanks for any help I can get!
#2
03/07/2009 (9:28 am)
Wow... I didn't even think about the fact that Torque could be using radians... I feel so thick! Thanks so much Orion!
Associate Orion Elenzil
Real Life Plus
try setting the value as radians instead of degrees.
note that 45 radians is 2578 degrees, and 2578 % 360 = 58.