intersectAABB2DvsCircle

View sourceintersectAABB2DvsCircle(a: BoundingBox2D, b: BoundingCircle): boolean

Returns whether a BoundingBox2D and a BoundingCircle overlap.

The circle center is clamped independently to the box’s x and y limits. The resulting point is the closest point on the box for the calculation. The helper returns true only when the squared distance from that point to the circle center is strictly less than b.r * b.r; a circle that only touches the box boundary therefore returns false. The inputs are not mutated, and their coordinates are not validated or reordered.

Parameters

NameDescriptionDefault
a

Box to test.

—
b

Circle to test.

—

Returns

Whether the circle reaches inside the box, excluding boundary-only contact.