Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
hpp::fcl::details::GJK Struct Reference

class for GJK algorithm More...

#include <hpp/fcl/narrowphase/gjk.h>

Collaboration diagram for hpp::fcl::details::GJK:
[legend]

Classes

struct  Simplex
 
struct  SimplexV
 

Public Types

enum  Status {
  Valid,
  Inside,
  Failed
}
 
typedef unsigned char vertex_id_t
 

Public Member Functions

 GJK (unsigned int max_iterations_, FCL_REAL tolerance_)
 
void initialize ()
 
Status evaluate (const MinkowskiDiff &shape, const Vec3f &guess)
 GJK algorithm, given the initial value guess. More...
 
void getSupport (const Vec3f &d, bool dIsNormalized, SimplexV &sv) const
 apply the support function along a direction, the result is return in sv More...
 
bool encloseOrigin ()
 whether the simplex enclose the origin More...
 
SimplexgetSimplex () const
 get the underlying simplex using in GJK, can be used for cache in next iteration More...
 
Vec3f getGuessFromSimplex () const
 get the guess from current simplex More...
 
void setDistanceEarlyBreak (const FCL_REAL &dup)
 Distance threshold for early break. More...
 

Static Public Member Functions

static bool getClosestPoints (const Simplex &simplex, Vec3f &w0, Vec3f &w1)
 Get the closest points on each object. More...
 

Public Attributes

MinkowskiDiff const * shape
 
Vec3f ray
 
FCL_REAL distance
 
Simplex simplices [2]
 

Detailed Description

class for GJK algorithm

Note
The computations are performed in the frame of the first shape.

Member Typedef Documentation

◆ vertex_id_t

typedef unsigned char hpp::fcl::details::GJK::vertex_id_t

Member Enumeration Documentation

◆ Status

Enumerator
Valid 
Inside 
Failed 

Constructor & Destructor Documentation

◆ GJK()

hpp::fcl::details::GJK::GJK ( unsigned int  max_iterations_,
FCL_REAL  tolerance_ 
)
inline

References initialize().

Member Function Documentation

◆ encloseOrigin()

bool hpp::fcl::details::GJK::encloseOrigin ( )

whether the simplex enclose the origin

◆ evaluate()

Status hpp::fcl::details::GJK::evaluate ( const MinkowskiDiff shape,
const Vec3f guess 
)

◆ getClosestPoints()

static bool hpp::fcl::details::GJK::getClosestPoints ( const Simplex simplex,
Vec3f w0,
Vec3f w1 
)
static

Get the closest points on each object.

Returns
true on success

Referenced by hpp::fcl::GJKSolver::shapeDistance(), hpp::fcl::GJKSolver::shapeIntersect(), and hpp::fcl::GJKSolver::shapeTriangleInteraction().

◆ getGuessFromSimplex()

Vec3f hpp::fcl::details::GJK::getGuessFromSimplex ( ) const

◆ getSimplex()

Simplex* hpp::fcl::details::GJK::getSimplex ( ) const
inline

get the underlying simplex using in GJK, can be used for cache in next iteration

Referenced by hpp::fcl::GJKSolver::shapeDistance(), and hpp::fcl::GJKSolver::shapeTriangleInteraction().

◆ getSupport()

void hpp::fcl::details::GJK::getSupport ( const Vec3f d,
bool  dIsNormalized,
SimplexV sv 
) const
inline

◆ initialize()

void hpp::fcl::details::GJK::initialize ( )

◆ setDistanceEarlyBreak()

void hpp::fcl::details::GJK::setDistanceEarlyBreak ( const FCL_REAL dup)
inline

Distance threshold for early break.

GJK stops when it proved the distance is more than this threshold.

Note
The closest points will be erroneous in this case. If you want the closest points, set this to infinity (the default).

Member Data Documentation

◆ distance

FCL_REAL hpp::fcl::details::GJK::distance

◆ ray

Vec3f hpp::fcl::details::GJK::ray

◆ shape

MinkowskiDiff const* hpp::fcl::details::GJK::shape

◆ simplices

Simplex hpp::fcl::details::GJK::simplices[2]