Angle Detection
by John Klotz · in Torque Game Builder · 07/14/2006 (9:03 am) · 5 replies
Is there a way to determine at what angle a specific object is traveling. For example, a gett2dangle function or something like that?
Thanks for any and all help
Thanks for any and all help
#2
07/15/2006 (5:49 am)
MAtan(%x, %y) is atan2 in TS. You can confirm that in the source if you please... I already did. It does return proper values, just different from the way mathematicians use angles. In math, 0 degrees points to the right, and positive angles go counter-clockwise. In TS, 0 degrees points up and positive angles go clockwise.
#4
07/16/2006 (6:24 pm)
Chris, that just gets the x component of the the linear velocity. That's not an angle.
#5
I've always used this to get the angle.
07/16/2006 (6:40 pm)
Really? It's getlinearVelocityPolar... the docs say:Quote:getLinearVelocityPolar()
Purpose
Gets the speed and direction at which the object is moving.
Return Value - List
The speed of the object as a float and the direction of the object as an angle in the form "angle
speed".
I've always used this to get the angle.
Torque Owner Paul /*Wedge*/ DElia