From 6343cb57bf9a4d2e308c380e224fc24a8fc866dc Mon Sep 17 00:00:00 2001 From: kai-z99 Date: Sat, 6 Jul 2024 17:13:36 -0700 Subject: [PATCH 1/2] remove function call --- src/rshapes.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rshapes.c b/src/rshapes.c index 9e7de1e2f681..8f5506b9af28 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -2172,11 +2172,14 @@ 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; } + // Check if point is inside a triangle defined by three points (p1, p2, p3) bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3) { From 6a49d2a28d62c235ca9833882d6f7c49b32381bd Mon Sep 17 00:00:00 2001 From: kai-z99 Date: Sat, 6 Jul 2024 17:14:37 -0700 Subject: [PATCH 2/2] fix --- src/rshapes.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rshapes.c b/src/rshapes.c index 8f5506b9af28..5d5ff02ca969 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -2179,7 +2179,6 @@ bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius) return collision; } - // Check if point is inside a triangle defined by three points (p1, p2, p3) bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3) {