Package frc.lib.math

Class SeparatingAxis

java.lang.Object
frc.lib.math.SeparatingAxis

public final class SeparatingAxis extends Object
Implementation of Separating Axis Theorem solver.
  • Method Details

    • solve

      public static boolean solve(ConvexShape shape1, ConvexShape shape2, Penetration penetration)
      Solve the for the separating axis between two convex shape.
      Parameters:
      shape1 - resolving object. Result contains the transform for this shape to no longer be penetrating.
      shape2 - pseudo-static object. Result assumes this shape does not move.
      penetration - out-parameter. Contains the direction and length of the minimum translation vector.
      Returns:
      true if shape1 and shape2 are intersecting. If false, penetration is unmodified.