mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-13 14:58:15 +00:00
[raymath] Hotfix for Vector2Angle() and Vector2LineAngle() (#3396)
* Hotfix for Vector2LineAngle(), should probably be reviewed along with the rest of raylib angle functions to determine what coordinate system we want. * Hotfix for Vector2LineAngle(), should probably be reviewed along with the rest of raylib angle functions to determine what coordinate system we want. * [raymath] Hotfix for Vector2Angle and corresponding example * [raymath] Hotfix for Vector2Angle and corresponding example --------- Co-authored-by: Ray <raysan5@gmail.com>
This commit is contained in:
@@ -324,8 +324,7 @@ 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);
|
||||
result = atan2f(det, dot);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user