A distance proxy is used by the GJK algorithm. It encapsulates any shape.

Constructors

Properties

m_count: number

Count

m_radius: number

Radius

m_vertices: b2Vec2[]

Verticies

Methods

  • Get the supporting vertex index in the given direction.

    Parameters

    • d: b2Vec2

      Direction to look for the supporting vertex.

    Returns number

    Supporting vertex index.

  • Get a vertex by index. Used by b2Distance.

    Parameters

    • index: number

      Vetex's index.

    Returns b2Vec2

    Vertex at the given index.

  • Get the vertex count.

    Returns number

    The number of vertices. (m_vertices.length)

  • Initialize the proxy using the given shape. The shape must remain in scope while the proxy is in use.

    Parameters

    • shape: b2Shape

      Shape to initialize the distance proxy.

    Returns void