Go to the documentation of this file.
81 #define SHAPE_INTERSECT_INVERTED(Shape1, Shape2) \
83 bool GJKSolver::shapeIntersect<Shape1, Shape2>( \
84 const Shape1& s1, const Transform3f& tf1, const Shape2& s2, \
85 const Transform3f& tf2, FCL_REAL& distance_lower_bound, \
86 bool enable_penetration, Vec3f* contact_points, Vec3f* normal) const { \
87 bool res = shapeIntersect(s2, tf2, s1, tf1, distance_lower_bound, \
88 enable_penetration, contact_points, normal); \
94 bool GJKSolver::shapeIntersect<Sphere, Capsule>(
99 contact_points, normal);
105 bool GJKSolver::shapeIntersect<Sphere, Sphere>(
110 contact_points, normal);
114 bool GJKSolver::shapeIntersect<Box, Sphere>(
117 Vec3f* normal)
const {
120 if (normal) *normal = n;
121 if (contact_points) *contact_points = pb;
142 bool GJKSolver::shapeIntersect<Sphere, Halfspace>(
145 Vec3f* normal)
const {
149 if (contact_points) *contact_points =
p1;
150 if (normal) *normal = n;
157 bool GJKSolver::shapeIntersect<Box, Halfspace>(
160 Vec3f* normal)
const {
164 if (contact_points) *contact_points =
p1;
165 if (normal) *normal = n;
172 bool GJKSolver::shapeIntersect<Capsule, Halfspace>(
175 Vec3f* normal)
const {
179 if (contact_points) *contact_points =
p1;
180 if (normal) *normal = n;
187 bool GJKSolver::shapeIntersect<Cylinder, Halfspace>(
190 Vec3f* normal)
const {
194 if (contact_points) *contact_points =
p1;
195 if (normal) *normal = n;
202 bool GJKSolver::shapeIntersect<Cone, Halfspace>(
205 Vec3f* normal)
const {
209 if (contact_points) *contact_points =
p1;
210 if (normal) *normal = n;
217 bool GJKSolver::shapeIntersect<Halfspace, Halfspace>(
231 bool GJKSolver::shapeIntersect<Plane, Halfspace>(
248 bool GJKSolver::shapeIntersect<Sphere, Plane>(
251 Vec3f* normal)
const {
255 if (contact_points) *contact_points =
p1;
256 if (normal) *normal = n;
263 bool GJKSolver::shapeIntersect<Box, Plane>(
266 Vec3f* normal)
const {
269 if (contact_points) *contact_points =
p1;
270 if (normal) *normal = n;
277 bool GJKSolver::shapeIntersect<Capsule, Plane>(
280 Vec3f* normal)
const {
284 if (contact_points) *contact_points =
p1;
285 if (normal) *normal = n;
292 bool GJKSolver::shapeIntersect<Cylinder, Plane>(
295 Vec3f* normal)
const {
299 if (contact_points) *contact_points =
p1;
300 if (normal) *normal = n;
307 bool GJKSolver::shapeIntersect<Cone, Plane>(
310 Vec3f* normal)
const {
313 if (contact_points) *contact_points =
p1;
314 if (normal) *normal = n;
321 bool GJKSolver::shapeIntersect<Plane, Plane>(
324 Vec3f* normal)
const {
384 bool GJKSolver::shapeDistance<Sphere, Capsule>(
const Sphere& s1,
394 bool GJKSolver::shapeDistance<Capsule, Sphere>(
const Capsule& s1,
404 bool GJKSolver::shapeDistance<Box, Sphere>(
const Box& s1,
409 Vec3f& normal)
const {
414 bool GJKSolver::shapeDistance<Sphere, Box>(
const Sphere& s1,
419 Vec3f& normal)
const {
427 bool GJKSolver::shapeDistance<Sphere, Cylinder>(
430 Vec3f& normal)
const {
436 bool GJKSolver::shapeDistance<Cylinder, Sphere>(
439 Vec3f& normal)
const {
445 bool GJKSolver::shapeDistance<Sphere, Sphere>(
const Sphere& s1,
455 bool GJKSolver::shapeDistance<Capsule, Capsule>(
463 bool GJKSolver::shapeDistance<TriangleP, TriangleP>(
466 Vec3f& normal)
const {
468 tf1.transform(s1.
c)),
469 t2(
tf2.transform(s2.
a),
tf2.transform(s2.
b),
tf2.transform(s2.
c));
475 guess = (t1.a + t1.b + t1.c - t2.
a - t2.
b - t2.
c) / 3;
477 bool enable_penetration =
true;
488 gjk.getClosestPoints(shape,
p1, p2);
499 if (enable_penetration) {
501 t1.a, t1.b, t1.c, t2.
a, t2.
b, t2.
c, normal);
502 dist = -penetrationDepth;
503 assert(dist <= 1e-6);
506 return penetrationDepth < 0;
511 assert(
false &&
"should not reach this point");
bool boxPlaneIntersect(const Box &s1, const Transform3f &tf1, const Plane &s2, const Transform3f &tf2, FCL_REAL &distance, Vec3f &p1, Vec3f &p2, Vec3f &normal)
box half space, a, b, c = +/- edge size n^T * (R(o + a v1 + b v2 + c v3) + T) ~ d so (R^T n) (a v1 + ...
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
bool sphereCapsuleIntersect(const Sphere &s1, const Transform3f &tf1, const Capsule &s2, const Transform3f &tf2, FCL_REAL &distance, Vec3f *contact_points, Vec3f *normal_)
size_t gjk_max_iterations
maximum number of iterations used for GJK iterations
bool sphereSphereDistance(const Sphere &s1, const Transform3f &tf1, const Sphere &s2, const Transform3f &tf2, FCL_REAL &dist, Vec3f &p1, Vec3f &p2, Vec3f &normal)
bool planeTriangleIntersect(const Plane &s1, const Transform3f &tf1, const Vec3f &P1, const Vec3f &P2, const Vec3f &P3, const Transform3f &tf2, FCL_REAL &distance, Vec3f &p1, Vec3f &p2, Vec3f &normal)
bool boxHalfspaceIntersect(const Box &s1, const Transform3f &tf1, const Halfspace &s2, const Transform3f &tf2)
box half space, a, b, c = +/- edge size n^T * (R(o + a v1 + b v2 + c v3) + T) <= d so (R^T n) (a v1 +...
Center at zero point sphere.
void set(const ShapeBase *shape0, const ShapeBase *shape1)
GJKInitialGuess gjk_initial_guess
which warm start to use for GJK
bool conePlaneIntersect(const Cone &s1, const Transform3f &tf1, const Plane &s2, const Transform3f &tf2, FCL_REAL &distance, Vec3f &p1, Vec3f &p2, Vec3f &normal)
bool shapeTriangleInteraction(const S &s, const Transform3f &tf1, const Vec3f &P1, const Vec3f &P2, const Vec3f &P3, const Transform3f &tf2, FCL_REAL &distance, Vec3f &p1, Vec3f &p2, Vec3f &normal) const
intersection checking between one shape and a triangle with transformation
HPP_FCL_DLLAPI FCL_REAL distance(const Matrix3f &R0, const Vec3f &T0, const kIOS &b1, const kIOS &b2, Vec3f *P=NULL, Vec3f *Q=NULL)
Approximate distance between two kIOS bounding volumes.
bool sphereSphereIntersect(const Sphere &s1, const Transform3f &tf1, const Sphere &s2, const Transform3f &tf2, FCL_REAL &distance, Vec3f *contact_points, Vec3f *normal)
Cylinder along Z axis. The cylinder is defined at its centroid.
bool sphereHalfspaceIntersect(const Sphere &s1, const Transform3f &tf1, const Halfspace &s2, const Transform3f &tf2, FCL_REAL &distance, Vec3f &p1, Vec3f &p2, Vec3f &normal)
bool sphereCapsuleDistance(const Sphere &s1, const Transform3f &tf1, const Capsule &s2, const Transform3f &tf2, FCL_REAL &dist, Vec3f &p1, Vec3f &p2, Vec3f &normal)
bool cylinderHalfspaceIntersect(const Cylinder &s1, const Transform3f &tf1, const Halfspace &s2, const Transform3f &tf2, FCL_REAL &distance, Vec3f &p1, Vec3f &p2, Vec3f &normal)
Minkowski difference class of two shapes.
HPP_FCL_DLLAPI std::size_t collide(const CollisionObject *o1, const CollisionObject *o2, const CollisionRequest &request, CollisionResult &result)
Main collision interface: given two collision objects, and the requirements for contacts,...
bool cylinderPlaneIntersect(const Cylinder &s1, const Transform3f &tf1, const Plane &s2, const Transform3f &tf2, FCL_REAL &distance, Vec3f &p1, Vec3f &p2, Vec3f &normal)
cylinder-plane intersect n^T (R (r * cosa * v1 + r * sina * v2 + h * v3) + T) ~ d need one point to b...
bool halfspaceTriangleIntersect(const Halfspace &s1, const Transform3f &tf1, const Vec3f &P1, const Vec3f &P2, const Vec3f &P3, const Transform3f &tf2, FCL_REAL &distance, Vec3f &p1, Vec3f &p2, Vec3f &normal)
bool coneHalfspaceIntersect(const Cone &s1, const Transform3f &tf1, const Halfspace &s2, const Transform3f &tf2, FCL_REAL &distance, Vec3f &p1, Vec3f &p2, Vec3f &normal)
bool enable_cached_guess
Whether smart guess can be provided @Deprecated Use gjk_initial_guess instead.
Status
Status of the GJK algorithm: Valid: GJK converged and the shapes are not in collision....
Eigen::Vector2i support_func_guess_t
bool capsuleHalfspaceIntersect(const Capsule &s1, const Transform3f &tf1, const Halfspace &s2, const Transform3f &tf2, FCL_REAL &distance, Vec3f &p1, Vec3f &p2, Vec3f &normal)
bool sphereCylinderDistance(const Sphere &s1, const Transform3f &tf1, const Cylinder &s2, const Transform3f &tf2, FCL_REAL &dist, Vec3f &p1, Vec3f &p2, Vec3f &normal)
bool spherePlaneIntersect(const Sphere &s1, const Transform3f &tf1, const Plane &s2, const Transform3f &tf2, FCL_REAL &distance, Vec3f &p1, Vec3f &p2, Vec3f &normal)
Cone The base of the cone is at and the top is at .
Capsule It is where is the distance between the point x and the capsule segment AB,...
Half Space: this is equivalent to the Plane in ODE. The separation plane is defined as n * x = d; Poi...
void initialize_gjk(details::GJK &gjk, const details::MinkowskiDiff &shape, const S1 &s1, const S2 &s2, Vec3f &guess, support_func_guess_t &support_hint) const
initialize GJK
bool planeHalfspaceIntersect(const Plane &s1, const Transform3f &tf1, const Halfspace &s2, const Transform3f &tf2, Plane &pl, Vec3f &p, Vec3f &d, FCL_REAL &penetration_depth, int &ret)
return whether plane collides with halfspace if the separation plane of the halfspace is parallel wit...
bool halfspaceIntersect(const Halfspace &s1, const Transform3f &tf1, const Halfspace &s2, const Transform3f &tf2, Vec3f &p, Vec3f &d, Halfspace &s, FCL_REAL &penetration_depth, int &ret)
Triangle stores the points instead of only indices of points.
bool sphereTriangleIntersect(const Sphere &s, const Transform3f &tf1, const Vec3f &P1, const Vec3f &P2, const Vec3f &P3, FCL_REAL &distance, Vec3f &p1, Vec3f &p2, Vec3f &normal_)
bool boxSphereDistance(const Box &b, const Transform3f &tfb, const Sphere &s, const Transform3f &tfs, FCL_REAL &dist, Vec3f &pb, Vec3f &ps, Vec3f &normal)
bool planeIntersect(const Plane &s1, const Transform3f &tf1, const Plane &s2, const Transform3f &tf2, Vec3f *, FCL_REAL *, Vec3f *)
FCL_REAL computePenetration(const Vec3f &P1, const Vec3f &P2, const Vec3f &P3, const Vec3f &Q1, const Vec3f &Q2, const Vec3f &Q3, Vec3f &normal)
See the prototype below.
FCL_REAL gjk_tolerance
the threshold used in GJK to stop iteration
support_func_guess_t support_func_cached_guess
smart guess for the support function
Vec3f cached_guess
smart guess
#define SHAPE_INTERSECT_INVERTED(Shape1, Shape2)
bool capsulePlaneIntersect(const Capsule &s1, const Transform3f &tf1, const Plane &s2, const Transform3f &tf2, FCL_REAL &distance, Vec3f &p1, Vec3f &p2, Vec3f &normal)
Center at zero point, axis aligned box.
hpp-fcl
Author(s):
autogenerated on Fri Aug 2 2024 02:45:14