Vector2AngleToPoint() Confusion
by practicing01 · in Torque 2D Professional · 10/03/2013 (10:24 pm) · 2 replies
Should this:
be this:
(line 240 of 2d/core/Vector2_ScriptBinding.h). Perhaps it's fine and I'm interpreting the output wrongly.
mRadToDeg( mAtan((p2.x - p1.x), (p1.y - p2.y)) );
be this:
mRadToDeg( mAtan((p2.y - p1.y), (p2.x - p1.x)) );
(line 240 of 2d/core/Vector2_ScriptBinding.h). Perhaps it's fine and I'm interpreting the output wrongly.
#2
In regards to the mAtan function, it will take its arguments as "(x, y)" or "(x y)" and will flip them when the C function is called. This will make it feel exactly like the rest of the Vector2 console functions.
10/04/2013 (12:19 pm)
Once that pull request is merged all angles will be defined using standard polar coordinates and math, scene object, and particle functions will all use the same convention. Right now there are a few inconsistencies where a given angle won't map directly to the angle that other functions expect.In regards to the mAtan function, it will take its arguments as "(x, y)" or "(x y)" and will flip them when the C function is called. This will make it feel exactly like the rest of the Vector2 console functions.
Associate Mike Lilligreen
Retired T2Der
There's an open pull request that fixes this and other angle issues, I will be merging it into the development branch shortly.