SAT()

Implementation of the separating axis theorem (SAT). Used to detect intersections between convex polyhedra. The code is based on the presentation The Separating Axis Test between convex polyhedra by Dirk Gregorius (Valve Software) from GDC 2013.

new SAT()

Author:

Methods

intersects(polyhedronA, polyhedronB) → {Boolean}

Returns true if the given convex polyhedra intersect. A polyhedron is just an array of Polygon objects.

Parameters:
Name Type Description
polyhedronA Polyhedron

The first convex polyhedron.

polyhedronB Polyhedron

The second convex polyhedron.

Returns:
Boolean -

Whether there is an intersection or not.