The first bounding box to test for collision.
The second bounding box to test for collision.
If true
, boxes that are merely touching are considered colliding; otherwise, only overlapping boxes are considered colliding. Defaults to false
.
An ActionResult
containing a boolean indicating collision, an array of SAT section results, and error information if applicable.
Determines whether two 2D bounding boxes collide using the Separating Axis Theorem (SAT).
The function projects both bounding boxes onto four axes (the local axes of each box) and checks for overlap in each projection. If the projections overlap on all axes, the boxes are colliding. Optionally, touching (contacting) boxes can be considered as colliding.