Hotfix for Vector2LineAngle(), should probably be reviewed along with the rest of raylib angle functions to determine what coordinate system we want. (#3394)

This commit is contained in:
Murlocohol
2023-10-10 02:59:09 -04:00
committed by GitHub
parent 0d8a6cfbfa
commit f0d949f931
2 changed files with 40 additions and 21 deletions

View File

@@ -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;
}