Browse Source

optimize (#4065)

pull/4068/head
kai-z99 6 months ago
committed by GitHub
parent
commit
fca53c7799
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/rshapes.c

+ 3
- 2
src/rshapes.c 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;
k">if (distance <= (radius1 + radius2)) collision = true;
n">collision = (distanceSquared <= (radiusSum * radiusSum));
return collision;
}

Loading…
Cancel
Save