# Class Distance.DistanceProxy

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

Enclosing class:
  `Distance`

public static class Distance.DistanceProxy extends Object
A distance proxy is used by the GJK algorithm. It encapsulates any shape. TODO: see if we can just do assignments with m_vertices, instead of copying stuff over

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final Vec2[]`
  `m_buffer`
  `int`
  `m_count`
  `float`
  `m_radius`
  `final Vec2[]`
  `m_vertices`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DistanceProxy()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final int`
  `getSupport(Vec2 d)`
  Get the supporting vertex index in the given direction.
  `final Vec2`
  `getSupportVertex(Vec2 d)`
  Get the supporting vertex in the given direction.
  `final Vec2`
  `getVertex(int index)`
  Get a vertex by index.
  `final int`
  `getVertexCount()`
  Get the vertex count.
  `final void`
  `set(Shape shape, int index)`
  Initialize the proxy using the given shape.

  ### Methods inherited from class Object

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

- ## Field Details

  - ### m_vertices

    public final Vec2[] m_vertices

  - ### m_count

    public int m_count

  - ### m_radius

    public float m_radius

  - ### m_buffer

    public final Vec2[] m_buffer

- ## Constructor Details

  - ### DistanceProxy

    public DistanceProxy()

- ## Method Details

  - ### set

    public final void set(Shape shape, int index)
    Initialize the proxy using the given shape. The shape must remain in scope while the proxy is in use.

  - ### getSupport

    public final int getSupport(Vec2 d)
    Get the supporting vertex index in the given direction.
    Parameters:
      `d` -
    Returns:

  - ### getSupportVertex

    public final Vec2 getSupportVertex(Vec2 d)
    Get the supporting vertex in the given direction.
    Parameters:
      `d` -
    Returns:

  - ### getVertexCount

    public final int getVertexCount()
    Get the vertex count.
    Returns:

  - ### getVertex

    public final Vec2 getVertex(int index)
    Get a vertex by index. Used by Distance.
    Parameters:
      `index` -
    Returns: