working 1
This commit is contained in:
parent
925e369c89
commit
747f9d9f1b
1 changed files with 23 additions and 59 deletions
|
|
@ -2334,7 +2334,10 @@ RLAPI bool CheckCollisionCircleLine(Vector2 center, float radius, Vector2 p1, Ve
|
|||
float closeX = p1.x + (dotProduct * (p2.x - p1.x));
|
||||
float closeY = p1.y + (dotProduct * (p2.y - p1.y));
|
||||
|
||||
bool onSegment = CheckCollisionPointLine((Vector2) { closeX, closeY }, p1, p2, 0);
|
||||
|
||||
Vector2 close = { closeX, closeY };
|
||||
|
||||
bool onSegment = CheckCollisionPointLine(close, p1, p2, 1);
|
||||
if (!onSegment) return false;
|
||||
|
||||
//distnce from circle to closest point
|
||||
|
|
|
|||
Loading…
Reference in a new issue