Separating Axis Theorem

The Separating Axis Theorem (SAT) can be used to determine if two arbitrary shapes intersect. Both shapes being tested must be convex. The SAT works by looking for at least one axis of separation between two objects. If no axis of separation exists, the objects are colliding. An axis of separation can be represented by any arbitrary plane:

Separating Axis Theorem

The first step in the SAT is to find an axis that we want to test for separation. In the example image above, the two oriented bounding boxes can havewo possible axes of separation. The X axis (1, 0) or the Y axis (0, 1) can separate these boxes.

Once we have figured out the axis of potential ...

Get Game Physics Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.