Module org.dyn4j

Class Sat

  • All Implemented Interfaces:
    NarrowphaseDetector

    public class Sat
    extends java.lang.Object
    implements NarrowphaseDetector
    Implementation of the Separating Axis Theorem (SAT) for collision detection.

    Sat states that "if two Convex objects are not penetrating, there exists an axis (vector) for which the projection of the objects does not overlap."

    The axes that must be tested are all the edge normals of both Convex Shapes. For each edge normal we project the Convex Shapes onto it yielding a 1 dimensional Interval. If any Interval doesn't overlap, then we can conclude the Convex Shapes do not intersect. If all the Intervals overlap, then we can conclude that the Convex Shapes intersect.

    If the Convex Shapes are penetrating, a Penetration object can be built from the Intervals with the least overlap. The normal will be the edge normal of the Interval and the depth will be the Interval overlap.

    Since:
    1.0.0
    Version:
    3.0.2
    Author:
    William Bittle
    See Also:
    SAT (Separating Axis Theorem)