Class Distance


  • public class Distance
    extends java.lang.Object
    This is non-static for faster pooling. To get an instance, use the SingletonPool, don't construct a distance object.
    • Field Detail

      • GJK_CALLS

        public static int GJK_CALLS
      • GJK_ITERS

        public static int GJK_ITERS
      • GJK_MAX_ITERS

        public static int GJK_MAX_ITERS
      • saveA

        private int[] saveA
      • saveB

        private int[] saveB
      • closestPoint

        private Vec2 closestPoint
      • temp

        private Vec2 temp
      • normal

        private Vec2 normal
    • Constructor Detail

      • Distance

        public Distance()
    • Method Detail

      • distance

        public final void distance​(DistanceOutput output,
                                   Distance.SimplexCache cache,
                                   DistanceInput input)
        Compute the closest points between two shapes. Supports any combination of: CircleShape and PolygonShape. The simplex cache is input/output. On the first call set SimplexCache.count to zero.
        Parameters:
        output -
        cache -
        input -