public static class Distance.DistanceProxy

  1. Object
  2. Distance.DistanceProxy
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

Fields

public final Vec2[] m_vertices
public int m_count
public float m_radius
public final Vec2[] m_buffer

Constructors

public DistanceProxy()

Methods

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

Inherited methods

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.

getSupportVertex

public final Vec2 getSupportVertex(Vec2 d)
Get the supporting vertex in the given direction.

getVertexCount

public final int getVertexCount()
Get the vertex count.

getVertex

public final Vec2 getVertex(int index)
Get a vertex by index. Used by Distance.