211
Ask a Question / Why can direction of self be over 360?
« on: June 16, 2012, 02:48:29 pm »
Hi there,
the subject says it all. I don't understand why the direction of an actor is not like any other angle, told with a number of degrees from -180 to 180, but instead it appears in can be any number. For example if I turn my actor in game clockwise, after reaching 180 it won't switch to -179, but it will be 181. Later it can be over 360 and more. It's really frustrating and I wish I would notice it earlier. Any reason why it works like this?
Is there any better workaround to get direction degrees in range of (almost) -180 to 180 then get reminder of direction/360 and check if it's more then 180, if it is, decrement it by 360?
Thanks for help.
the subject says it all. I don't understand why the direction of an actor is not like any other angle, told with a number of degrees from -180 to 180, but instead it appears in can be any number. For example if I turn my actor in game clockwise, after reaching 180 it won't switch to -179, but it will be 181. Later it can be over 360 and more. It's really frustrating and I wish I would notice it earlier. Any reason why it works like this?
Is there any better workaround to get direction degrees in range of (almost) -180 to 180 then get reminder of direction/360 and check if it's more then 180, if it is, decrement it by 360?
Thanks for help.