summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorkai-z99 <[email protected]>2024-07-07 00:05:25 -0700
committerGitHub <[email protected]>2024-07-07 09:05:25 +0200
commit1039e3c1bd61ce8694c6c191d6b34eb4807e5aae (patch)
treeb8e67148f8c98f535c53041d3b8a41df7d229a16
parent9a280cda0be211ee751cdb44fedab8f1e698be2a (diff)
downloadraylib-1039e3c1bd61ce8694c6c191d6b34eb4807e5aae.tar.gz
raylib-1039e3c1bd61ce8694c6c191d6b34eb4807e5aae.zip
[rshapes] Give CheckCollisionPointCircle() its own implementation (#4135)
* remove function call * fix
-rw-r--r--src/rshapes.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rshapes.c b/src/rshapes.c
index 9e7de1e2..5d5ff02c 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;
}