# Class Distance

java.lang.Object
com.codename1.gaming.physics.box2d.collision.Distance

public class Distance extends Object

This is non-static for faster pooling. To get an instance, use the

invalid reference

    SingletonPool

, don't

construct a distance object.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `Distance.DistanceProxy`
  A distance proxy is used by the GJK algorithm.
  `static class`
  `Distance.SimplexCache`
  Used to warm start Distance.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static int`
  `GJK_CALLS`
  `static int`
  `GJK_ITERS`
  `static int`
  `GJK_MAX_ITERS`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Distance()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final void`
  `distance(DistanceOutput output, Distance.SimplexCache cache, DistanceInput input)`
  Compute the closest points between two shapes.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### GJK_CALLS

    public static int GJK_CALLS

  - ### GJK_ITERS

    public static int GJK_ITERS

  - ### GJK_MAX_ITERS

    public static int GJK_MAX_ITERS

- ## Constructor Details

  - ### Distance

    public Distance()

- ## Method Details

  - ### 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` -