How SAT.js works: Collision detection and response
masterSAT.js is a 2D collision detection library based on the Separating Axis Theorem. It supports detecting collisions between:
- Circles (using Voronoi Regions)
- Convex Polygons (including Axis-Aligned Boxes)
It can also perform hit testing to check if a point is inside a circle or a polygon. The library supports both simple detection (returning a boolean) and collision response (calculating overlap magnitude and vectors).