Class SAT

java.lang.Object
buildengine.math.collision.SAT

public class SAT extends Object
Separating Axis Theorem This is a static-only class and contains calculations regarding collisions. The collisions are calculated using an implementation off Separating Axis Theorem. This class uses the custom Shape library.
Author:
Kai v. Maurik
  • Constructor Details

    • SAT

      public SAT()
  • Method Details

    • collidePolygons

      public static Contact collidePolygons(Polygon a, Polygon b)
      Check if two polygons are colliding
      Parameters:
      a - The first polygon
      b - The second polygon
      Returns:
      A contact object if there is collision containing the collision information. Otherwise returns null.
    • containsPoint

      public static Contact containsPoint(Polygon a, Vector2f v)
      Check if a polygon contains a specified point
      Parameters:
      a - The polygon
      v - The point
      Returns:
      A contact object if there is collision containing the collision information. Otherwise returns null.