From 1039e3c1bd61ce8694c6c191d6b34eb4807e5aae Mon Sep 17 00:00:00 2001 From: kai-z99 <147789796+kai-z99@users.noreply.github.com> Date: Sun, 7 Jul 2024 00:05:25 -0700 Subject: [PATCH] [rshapes] Give CheckCollisionPointCircle() its own implementation (#4135) * remove function call * fix --- src/rshapes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rshapes.c b/src/rshapes.c index 9e7de1e2f681..5d5ff02ca969 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -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; }