mirror of
https://github.com/raysan5/raylib.git
synced 2026-02-03 04:39:18 -05:00
Fix CheckCollisionCircleRec() (#3584)
This commit is contained in:
@ -2132,11 +2132,11 @@ bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec)
|
||||
{
|
||||
bool collision = false;
|
||||
|
||||
int recCenterX = (int)(rec.x + rec.width/2.0f);
|
||||
int recCenterY = (int)(rec.y + rec.height/2.0f);
|
||||
float recCenterX = rec.x + rec.width/2.0f;
|
||||
float recCenterY = rec.y + rec.height/2.0f;
|
||||
|
||||
float dx = fabsf(center.x - (float)recCenterX);
|
||||
float dy = fabsf(center.y - (float)recCenterY);
|
||||
float dx = fabsf(center.x - recCenterX);
|
||||
float dy = fabsf(center.y - recCenterY);
|
||||
|
||||
if (dx > (rec.width/2.0f + radius)) { return false; }
|
||||
if (dy > (rec.height/2.0f + radius)) { return false; }
|
||||
|
||||
Reference in New Issue
Block a user