summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMurlocohol <[email protected]>2023-10-10 02:59:09 -0400
committerGitHub <[email protected]>2023-10-10 08:59:09 +0200
commitf0d949f931e286773aa0d0b87af4f58214ef611b (patch)
tree927414f32493838d85bd982728017cfb40c3f700 /src
parent0d8a6cfbfa474be123cedff6a4faddfe5443fcec (diff)
downloadraylib-f0d949f931e286773aa0d0b87af4f58214ef611b.tar.gz
raylib-f0d949f931e286773aa0d0b87af4f58214ef611b.zip
Hotfix for Vector2LineAngle(), should probably be reviewed along with the rest of raylib angle functions to determine what coordinate system we want. (#3394)
Diffstat (limited to 'src')
-rw-r--r--src/raymath.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/raymath.h b/src/raymath.h
index db04c51e..b01b0b22 100644
--- a/src/raymath.h
+++ b/src/raymath.h
@@ -323,6 +323,8 @@ RMAPI float Vector2Angle(Vector2 v1, Vector2 v2)
float dot = v1.x*v2.x + v1.y*v2.y;
float det = v1.x*v2.y - v1.y*v2.x;
+
+ // TODO(10/9/2023): Currently angles move clockwise, determine if this is wanted behavior
result = -atan2f(det, dot);
return result;
@@ -335,7 +337,8 @@ RMAPI float Vector2LineAngle(Vector2 start, Vector2 end)
{
float result = 0.0f;
- result = atan2f(end.y - start.y, end.x - start.x);
+ // TODO(10/9/2023): Currently angles move clockwise, determine if this is wanted behavior
+ result = -atan2f(end.y - start.y, end.x - start.x);
return result;
}