Merge pull request #18 from Behiiri/dev

Fix for v2_rotate
This commit is contained in:
Charlie 2024-08-15 13:20:31 +02:00 committed by GitHub
commit 3dc1fd27aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -181,15 +181,11 @@ Vector2 v2_rotate_point_around_pivot(Vector2 point, Vector2 pivot, float32 rotat
float32 s = sin(rotation_radians);
float32 c = cos(rotation_radians);
point.x -= pivot.x;
point.y -= pivot.y;
point = v2_sub(point, pivot);
float32 x_new = point.x * c - point.y * s;
float32 y_new = point.x * s + point.y * c;
point.x = x_new + pivot.x;
point.y = y_new + pivot.y;
point = v2_add(v2(x_new, y_new), pivot);
return point;