80 const Vec3f& dir,
bool dirIsNormalized,
Vec3f& support0,
Vec3f& support1,
97 return getSupport(shapes[0], d, dIsNormalized, hint);
103 return oR1 *
getSupport(shapes[1], oR1.transpose() * d, dIsNormalized, hint) + ot1;
109 assert(getSupportFunc != NULL);
110 getSupportFunc(*
this, d, dIsNormalized, supp0, supp1, hint);
161 GJK(
unsigned int max_iterations_,
FCL_REAL tolerance_) : max_iterations(max_iterations_),
162 tolerance(tolerance_)
177 shape->
support(d, dIsNormalized, sv.
w0, sv.
w1, hint);
178 sv.
w.noalias() = sv.
w0 - sv.
w1;
182 bool encloseOrigin();
193 return distance < distance_upper_bound;
202 return distance > - shape.
inflation.sum();
210 Vec3f getGuessFromSimplex()
const;
218 distance_upper_bound = dup;
229 unsigned int max_iterations;
234 inline void removeVertex(
Simplex& simplex);
237 inline void appendVertex(
Simplex& simplex,
const Vec3f& v,
bool isNormalized,
244 bool projectTriangleOrigin(
const Simplex& current,
Simplex& next);
247 bool projectTetrahedraOrigin(
const Simplex& current,
Simplex& next);
251 static const size_t EPA_MAX_FACES = 128;
252 static const size_t EPA_MAX_VERTICES = 64;
253 static const FCL_REAL EPA_EPS = 0.000001;
254 static const size_t EPA_MAX_ITERATIONS = 255;
282 if(root) root->
l[0] = face;
289 if(face->l[1]) face->
l[1]->
l[0] = face->
l[0];
290 if(face->l[0]) face->
l[0]->
l[1] = face->
l[1];
291 if(face == root) root = face->
l[1];
298 fa->
e[ea] = eb; fa->
f[ea] = fb;
299 fb->
e[eb] = ea; fb->
f[eb] = fa;
311 unsigned int max_face_num;
312 unsigned int max_vertex_num;
313 unsigned int max_iterations;
321 AccuracyReached = 1 << 1 | Valid ,
322 Degenerated = 1 << 1 | Failed,
323 NonConvex = 2 << 1 | Failed,
324 InvalidHull = 3 << 1 | Failed,
325 OutOfFaces = 4 << 1 | Failed,
326 OutOfVertices = 5 << 1 | Failed,
327 FallBack = 6 << 1 | Failed
339 EPA(
unsigned int max_face_num_,
unsigned int max_vertex_num_,
unsigned int max_iterations_,
FCL_REAL tolerance_) : max_face_num(max_face_num_),
340 max_vertex_num(max_vertex_num_),
341 max_iterations(max_iterations_),
342 tolerance(tolerance_)
367 SimplexF* newFace(SimplexV* a, SimplexV* b, SimplexV* vertex,
bool forced);
SimplexList stock
Definition: gjk.h:337
MinkowskiDiff const * shape
Definition: gjk.h:141
support_func_guess_t support_hint
Definition: gjk.h:143
Eigen::Array< FCL_REAL, 1, 2 > inflation
The radius of the sphere swepted volume. The 2 values correspond to the inflation of shape 0 and shap...
Definition: gjk.h:77
GJK::Simplex result
Definition: gjk.h:331
Status
Definition: gjk.h:318
MinkowskiDiff()
Definition: gjk.h:84
Main namespace.
Definition: AABB.h:43
size_t pass
Definition: gjk.h:268
Vec3f support0(const Vec3f &d, bool dIsNormalized, int &hint) const
support function for shape0
Definition: gjk.h:95
Vec3f n
Definition: gjk.h:262
bool initialize(MeshCollisionTraversalNode< BV, RelativeTransformationIsIdentity > &node, BVHModel< BV > &model1, Transform3f &tf1, BVHModel< BV > &model2, Transform3f &tf2, CollisionResult &result, bool use_refit=false, bool refit_bottomup=false)
Initialize traversal node for collision between two meshes, given the current transforms.
Definition: traversal_node_setup.h:407
Simplex()
Definition: gjk.h:136
SimplexF * f[3]
Definition: gjk.h:265
Eigen::Matrix< FCL_REAL, 3, 3 > Matrix3f
Definition: data_types.h:75
Vec3f getSupport(const ShapeBase *shape, const Vec3f &dir, bool dirIsNormalized, int &hint)
the support function for shape
EPA(unsigned int max_face_num_, unsigned int max_vertex_num_, unsigned int max_iterations_, FCL_REAL tolerance_)
Definition: gjk.h:339
void append(SimplexF *face)
Definition: gjk.h:278
class for GJK algorithm
Definition: gjk.h:117
SimplexF * cf
Definition: gjk.h:304
Vec3f support1(const Vec3f &d, bool dIsNormalized, int &hint) const
support function for shape1
Definition: gjk.h:101
Vec3f ray
Definition: gjk.h:142
Vec3f w
support vector (i.e., the furthest point on the shape along the support direction) ...
Definition: gjk.h:124
Minkowski difference class of two shapes.
Definition: gjk.h:62
class for EPA algorithm
Definition: gjk.h:257
static void bind(SimplexF *fa, size_t ea, SimplexF *fb, size_t eb)
Definition: gjk.h:296
Base class for all basic geometric shapes.
Definition: geometric_shapes.h:54
SimplexF * ff
Definition: gjk.h:305
Vec3f w1
Definition: gjk.h:122
GJK(unsigned int max_iterations_, FCL_REAL tolerance_)
Definition: gjk.h:161
SimplexHorizon()
Definition: gjk.h:307
double FCL_REAL
Definition: data_types.h:69
GetSupportFunction getSupportFunc
Definition: gjk.h:82
Definition: traversal_node_setup.h:775
size_t nextsv
Definition: gjk.h:336
Vec3f ot1
translation from shape1 to shape0 such that .
Definition: gjk.h:73
SimplexF * root
Definition: gjk.h:275
Status
Definition: gjk.h:139
Simplex * getSimplex() const
get the underlying simplex using in GJK, can be used for cache in next iteration
Definition: gjk.h:185
SimplexList()
Definition: gjk.h:277
Eigen::Vector2i support_func_guess_t
Definition: data_types.h:76
FCL_REAL depth
Definition: gjk.h:333
FCL_REAL distance
Definition: gjk.h:157
Vec3f w0
support vector for shape 0 and 1.
Definition: gjk.h:122
~EPA()
Definition: gjk.h:347
unsigned char vertex_id_t
Definition: gjk.h:127
void support(const Vec3f &d, bool dIsNormalized, Vec3f &supp0, Vec3f &supp1, support_func_guess_t &hint) const
support function for the pair of shapes
Definition: gjk.h:107
FCL_REAL d
Definition: gjk.h:263
SimplexV * sv_store
Definition: gjk.h:334
size_t nf
Definition: gjk.h:306
SimplexF()
Definition: gjk.h:270
SimplexF * fc_store
Definition: gjk.h:335
size_t count
Definition: gjk.h:276
void setDistanceEarlyBreak(const FCL_REAL &dup)
Distance threshold for early break. GJK stops when it proved the distance is more than this threshold...
Definition: gjk.h:216
vertex_id_t rank
size of simplex (number of vertices)
Definition: gjk.h:134
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
Definition: data_types.h:74
bool hasClosestPoints()
Tells whether the closest points are available.
Definition: gjk.h:191
Vec3f normal
Definition: gjk.h:332
Matrix3f oR1
rotation from shape1 to shape0 such that .
Definition: gjk.h:69
size_t e[3]
Definition: gjk.h:267
SimplexF * l[2]
Definition: gjk.h:266
Status status
Definition: gjk.h:330
GJK::SimplexV SimplexV
Definition: gjk.h:259
bool hasPenetrationInformation(const MinkowskiDiff &shape)
Definition: gjk.h:200
void getSupport(const Vec3f &d, bool dIsNormalized, SimplexV &sv, support_func_guess_t &hint) const
apply the support function along a direction, the result is return in sv
Definition: gjk.h:174
#define HPP_FCL_DLLAPI
Definition: config.hh:64