Skip to content

Commit

Permalink
[rshapes] Give CheckCollisionPointCircle() its own implementation (#4135
Browse files Browse the repository at this point in the history
)

* remove function call

* fix
  • Loading branch information
kai-z99 authored Jul 7, 2024
1 parent 9a280cd commit 1039e3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rshapes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,9 @@ bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius)
{
bool collision = false;

collision = CheckCollisionCircles(point, 0, center, radius);
float distanceSquared = (point.x - center.x) * (point.x - center.x) + (point.y - center.y) * (point.y - center.y);

collision = distanceSquared <= radius * radius;

return collision;
}
Expand Down

0 comments on commit 1039e3c

Please sign in to comment.