Box2D  2.4.1
A 2D physics engine for games
b2DistanceProxy Struct Reference

#include <b2_distance.h>

Public Member Functions

void Set (const b2Shape *shape, int32 index)
 
void Set (const b2Vec2 *vertices, int32 count, float radius)
 
int32 GetSupport (const b2Vec2 &d) const
 Get the supporting vertex index in the given direction.
 
const b2Vec2GetSupportVertex (const b2Vec2 &d) const
 Get the supporting vertex in the given direction.
 
int32 GetVertexCount () const
 Get the vertex count.
 
const b2Vec2GetVertex (int32 index) const
 Get a vertex by index. Used by b2Distance.
 

Public Attributes

b2Vec2 m_buffer [2]
 
const b2Vec2m_vertices
 
int32 m_count
 
float m_radius
 

Detailed Description

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

Member Function Documentation

◆ Set() [1/2]

void b2DistanceProxy::Set ( const b2Shape shape,
int32  index 
)

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

◆ Set() [2/2]

void b2DistanceProxy::Set ( const b2Vec2 vertices,
int32  count,
float  radius 
)

Initialize the proxy using a vertex cloud and radius. The vertices must remain in scope while the proxy is in use.


The documentation for this struct was generated from the following file: