Convex Polygon Collisions: AABB and Separating Axis Theorem Explained

Added:

Convex Basics
Algorithm Demo
SAT Theory
Projection Math
SAT Code
Diagonals Method
Diag Code
Static Response
SAT Static
Final Note

Convex Basics

0:00
Playing Section
  • 1

    Defines convex polygons and contrasts with concave shapes.

  • 2

    Explains why rectangles and squares are relevant to the topic.

  • 3

    Covers the simple AABB collision check for unrotated shapes.

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.