Struct EPA

Nested Relationships

Nested Types

Struct Documentation

struct EPA

class for EPA algorithm

Public Types

enum Status

Values:

enumerator DidNotRun
enumerator Failed
enumerator Valid
enumerator AccuracyReached
enumerator Degenerated
enumerator NonConvex
enumerator InvalidHull
enumerator OutOfFaces
enumerator OutOfVertices
enumerator FallBack
typedef GJK::SimplexV SimplexVertex

Public Functions

inline EPA(size_t max_iterations_, CoalScalar tolerance_)
inline EPA(const EPA &other)

Copy constructor of EPA. Mostly needed for the copy constructor of GJKSolver.

inline size_t getNumMaxIterations() const

Get the max number of iterations of EPA.

inline size_t getNumMaxVertices() const

Get the max number of vertices of EPA.

inline size_t getNumMaxFaces() const

Get the max number of faces of EPA.

inline CoalScalar getTolerance() const

Get the tolerance of EPA.

inline size_t getNumIterations() const

Get the number of iterations of the last run of EPA.

inline size_t getNumVertices() const

Get the number of vertices in the polytope of the last run of EPA.

inline size_t getNumFaces() const

Get the number of faces in the polytope of the last run of EPA.

void reset(size_t max_iterations, CoalScalar tolerance)

resets the EPA algorithm, preparing it for a new run. It potentially reallocates memory for the vertices and faces if the passed parameters are bigger than the previous ones. This function does not modify the parameters of the EPA algorithm, i.e. the maximum number of iterations and the tolerance.

Note

calling this function destroys the previous state of EPA. In the future, we may want to copy it instead, i.e. when EPA will be (properly) warm-startable.

Status evaluate(GJK &gjk, const Vec3s &guess)
Returns:

a Status which can be demangled using (status & Valid) or (status & Failed). The other values provide a more detailled status

void getWitnessPointsAndNormal(const MinkowskiDiff &shape, Vec3s &w0, Vec3s &w1, Vec3s &normal) const

Get the witness points on each object, and the corresponding normal.

Parameters:
  • shape[in] is the Minkowski difference of the two shapes.

  • w0[out] is the witness point on shape0.

  • w1[out] is the witness point on shape1.

  • normal[in] is the normal found by EPA. It points from shape0 to shape1. The normal is used to correct the witness points on the shapes if the shapes have a non-zero swept-sphere radius.

Public Members

Status status
GJK::Simplex result
Vec3s normal
support_func_guess_t support_hint
CoalScalar depth
SimplexFace *closest_face

Public Static Functions

static inline void bind(SimplexFace *fa, size_t ea, SimplexFace *fb, size_t eb)

We bind the face fa along its edge ea to the face fb along its edge fb.

struct SimplexFace

Public Functions

inline SimplexFace()

Public Members

Vec3s n
CoalScalar d
bool ignore
size_t vertex_id[3]
SimplexFace *adjacent_faces[3]
SimplexFace *prev_face
SimplexFace *next_face
size_t adjacent_edge[3]
size_t pass
struct SimplexFaceList

The simplex list of EPA is a linked list of faces. Note: EPA’s linked list does not own any memory. The memory it refers to is contiguous and owned by a std::vector.

Public Functions

inline SimplexFaceList()
inline void reset()
inline void append(SimplexFace *face)
inline void remove(SimplexFace *face)

Public Members

SimplexFace *root
size_t count
struct SimplexHorizon

Public Functions

inline SimplexHorizon()

Public Members

SimplexFace *current_face
SimplexFace *first_face
size_t num_faces