Skip to content

Commit

Permalink
REVIEWED: CheckCollisionPointRec()
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed Jul 7, 2024
1 parent 1039e3c commit a824072
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rshapes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2172,9 +2172,9 @@ bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius)
{
bool collision = false;

float distanceSquared = (point.x - center.x) * (point.x - center.x) + (point.y - center.y) * (point.y - center.y);
float distanceSquared = (point.x - center.x)*(point.x - center.x) + (point.y - center.y)*(point.y - center.y);

collision = distanceSquared <= radius * radius;
if (distanceSquared <= radius*radius) collision = true;

return collision;
}
Expand Down

0 comments on commit a824072

Please sign in to comment.