This commit is contained in:
kai-z99 2024-06-13 23:19:17 -07:00 committed by GitHub
parent df849d2fb0
commit fca53c7799
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2233,9 +2233,10 @@ bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, floa
float dx = center2.x - center1.x; // X distance between centers
float dy = center2.y - center1.y; // Y distance between centers
float distance = sqrtf(dx*dx + dy*dy); // Distance between centers
float distanceSquared = dx * dx + dy * dy; // Distance between centers squared
float radiusSum = radius1 + radius2;
if (distance <= (radius1 + radius2)) collision = true;
collision = (distanceSquared <= (radiusSum * radiusSum));
return collision;
}