Class b2DistanceProxy

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

Index

Properties

Methods

Properties

public m_count: number

Count

public m_radius: number

Radius

public m_vertices: b2Vec2[]

Verticies

Methods

public GetSupport(d: b2Vec2): number

Get the supporting vertex index in the given direction.

Parameters

  • d: b2Vec2

    Direction to look for the supporting vertex.

Returns

number

Supporting vertex index.

public GetSupportVertex(d: b2Vec2): b2Vec2

Get the supporting vertex in the given direction.

Parameters

  • d: b2Vec2

    Direction to look for the supporting vertex.

Returns

b2Vec2

Supporting vertex.

public GetVertex(index: number): b2Vec2

Get a vertex by index. Used by b2Distance.

Parameters

  • index: number

    Vetex's index.

Returns

b2Vec2

Vertex at the given index.

public GetVertexCount(): number

Get the vertex count.

Returns

number

The number of vertices. (m_vertices.length)

public Set(shape: b2Shape)

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.