Convex Polygon Collisions: AABB and Separating Axis Theorem Explained

Added:

The GJK-EPA Framework and Continuous Collision Detection (CCD)

While the Separating Axis Theorem (SAT) and Axis-Aligned Bounding Boxes (AABB) with static resolution are intuitive, they possess significant limitations in modern game physics. SAT's computational complexity scales poorly for high-vertex 3D shapes, and static resolution suffers from 'tunneling'—where fast-moving objects pass through obstacles without registering a collision. As an alternative, the Gilbert-Johnson-Keerthi (GJK) algorithm, paired with the Expanding Polytope Algorithm (EPA), offers a highly efficient approach for convex collision detection by utilizing the Minkowski difference. Furthermore, to address the flaws of static resolution, developers use Continuous Collision Detection (CCD). Instead of checking for overlaps at discrete time steps, CCD calculates the exact Time of Impact (TOI) using swept volumes or numerical root-finding, preventing tunneling and ensuring physical accuracy for high-speed interactions.

Vector Mathematics: A solid understanding of 2D vectors, dot products, vector projection, and finding normal vectors.
Geometric Properties of Polygons: Knowing the difference between convex and concave polygons and why certain mathematical theorems only apply to the former.
Foundational Collision Concepts: Familiarity with basic bounding volumes (like circles and AABBs) and the distinction between broad-phase and narrow-phase collision detection.
Coordinate Systems: Understanding how 2D screen/world coordinates function in programming environments and game engines.
Dynamic Collision Resolution: Implementing impulse-based physics to calculate realistic post-collision velocities, forces, and angular momentum.
Continuous Collision Detection (CCD): Addressing the 'tunneling' artifact where fast-moving objects pass through boundaries by utilizing sweep tests or time-of-impact (TOI) algorithms.
Spatial Partitioning Techniques: Learning broad-phase optimization structures like Quadtrees, Octrees, or Spatial Hashing to handle collisions efficiently among hundreds of objects.
GJK (Gilbert-Johnson-Keerthi) Algorithm: Exploring advanced, faster mathematical frameworks for narrow-phase distance and collision detection of convex shapes in both 2D and 3D.
Concave Polygon Decomposition: Implementing triangulation or convex decomposition algorithms to handle complex, non-convex shapes using the Separating Axis Theorem.
136.4K views4.1Klikes36:40@javidx9Original Release: 2019-02-02

The Separated Axis Theorem (SAT) is a fundamental algorithm for detecting collisions between convex polygons by projecting all points of each polygon onto axes perpendicular to each edge of both polygons; if the projections overlap on all axes, the polygons are colliding, otherwise they are separated. An alternative approach involves testing intersections between diagonals of one polygon and edges of another polygon, which can also detect collisions and provide additional information for static collision resolution.