diff options
| author | Murlocohol <[email protected]> | 2023-10-10 04:42:11 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-10-10 10:42:11 +0200 |
| commit | 9702a17152d137766d85cd02060219787e3e228b (patch) | |
| tree | 6057e9085aa81c11c22f4100e0463d1596a2728c /examples | |
| parent | f0d949f931e286773aa0d0b87af4f58214ef611b (diff) | |
| download | raylib-9702a17152d137766d85cd02060219787e3e228b.tar.gz raylib-9702a17152d137766d85cd02060219787e3e228b.zip | |
[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 <[email protected]>
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/others/raymath_vector_angle.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/others/raymath_vector_angle.c b/examples/others/raymath_vector_angle.c index ab8ccf57..dc6887a4 100644 --- a/examples/others/raymath_vector_angle.c +++ b/examples/others/raymath_vector_angle.c @@ -44,7 +44,7 @@ int main(void) //---------------------------------------------------------------------------------- float startangle; - if (angleMode == 0) startangle = -Vector2LineAngle(v0, v1)*RAD2DEG; + if (angleMode == 0) startangle = Vector2LineAngle(v0, v1)*RAD2DEG; if (angleMode == 1) startangle = 0.0f; v2 = GetMousePosition(); @@ -81,8 +81,8 @@ int main(void) DrawLineEx(v0, v1, 2.0f, BLACK); DrawLineEx(v0, v2, 2.0f, RED); - - DrawCircleSector(v0, 40.0f, startangle, startangle - angle, 32, Fade(GREEN, 0.6f)); + + DrawCircleSector(v0, 40.0f, startangle, startangle + angle, 32, Fade(GREEN, 0.6f)); } else if (angleMode == 1) { @@ -90,8 +90,8 @@ int main(void) DrawLine(0, screenHeight/2, screenWidth, screenHeight/2, LIGHTGRAY); DrawLineEx(v0, v2, 2.0f, RED); - - DrawCircleSector(v0, 40.0f, startangle, startangle - angle, 32, Fade(GREEN, 0.6f)); + + DrawCircleSector(v0, 40.0f, startangle, startangle + angle, 32, Fade(GREEN, 0.6f)); } DrawText("v0", v0.x, v0.y, 10, DARKGRAY); |
