hpp-fcl  3.0.0
HPP fork of FCL -- The Flexible Collision Library
hpp::fcl::details Namespace Reference

Classes

struct  UpdateBoundingVolume
 
struct  UpdateBoundingVolume< AABB >
 
struct  GJK
 class for GJK algorithm More...
 
struct  EPA
 class for EPA algorithm More...
 
struct  MinkowskiDiff
 Minkowski difference class of two shapes. More...
 
struct  ShapeSupportData
 Stores temporary data for the computation of support points. More...
 
struct  LargeConvex
 Cast a ConvexBase to a LargeConvex to use the log version of getShapeSupport. This is much faster than the linear version of getShapeSupport when a ConvexBase has more than a few dozen of vertices. More...
 
struct  SmallConvex
 See LargeConvex. More...
 

Enumerations

enum  SupportOptions { NoSweptSphere = 0 , WithSweptSphere = 0x1 }
 Options for the computation of support points. NoSweptSphere option is used when the support function is called by GJK or EPA. In this case, the swept sphere radius is not taken into account in the support function. It is used by GJK and EPA after they have converged to correct the solution. WithSweptSphere option is used when the support function is called directly by the user. In this case, the swept sphere radius is taken into account in the support function. More...
 

Functions

template<int _SupportOptions = SupportOptions::NoSweptSphere>
Vec3f getSupport (const ShapeBase *shape, const Vec3f &dir, int &hint)
 the support function for shape. The output support point is expressed in the local frame of the shape. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupport (const TriangleP *triangle, const Vec3f &dir, Vec3f &support, int &, ShapeSupportData &)
 Triangle support function. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupport (const Box *box, const Vec3f &dir, Vec3f &support, int &, ShapeSupportData &)
 Box support function. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupport (const Sphere *sphere, const Vec3f &dir, Vec3f &support, int &, ShapeSupportData &)
 Sphere support function. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupport (const Ellipsoid *ellipsoid, const Vec3f &dir, Vec3f &support, int &, ShapeSupportData &)
 Ellipsoid support function. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupport (const Capsule *capsule, const Vec3f &dir, Vec3f &support, int &, ShapeSupportData &)
 Capsule support function. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupport (const Cone *cone, const Vec3f &dir, Vec3f &support, int &, ShapeSupportData &)
 Cone support function. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupport (const Cylinder *cylinder, const Vec3f &dir, Vec3f &support, int &, ShapeSupportData &)
 Cylinder support function. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupport (const ConvexBase *convex, const Vec3f &dir, Vec3f &support, int &hint, ShapeSupportData &)
 ConvexBase support function. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupport (const SmallConvex *convex, const Vec3f &dir, Vec3f &support, int &hint, ShapeSupportData &data)
 Support function for large ConvexBase (>32 vertices). More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupport (const LargeConvex *convex, const Vec3f &dir, Vec3f &support, int &hint, ShapeSupportData &support_data)
 Support function for small ConvexBase (<32 vertices). More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getSupportSet (const ShapeBase *shape, SupportSet &support_set, int &hint, size_t num_sampled_supports=6, FCL_REAL tol=1e-3)
 Computes the support set for shape. This function assumes the frame of the support set has already been computed and that this frame is expressed w.r.t the local frame of the shape (i.e. the local frame of the shape is the WORLD frame of the support set). The support direction used to compute the support set is the positive z-axis if the support set has the DEFAULT direction; negative z-axis if it has the INVERTED direction. (In short, a shape's support set is has the DEFAULT direction if the shape is the first shape in a collision pair. It has the INVERTED direction if the shape is the second one in the collision pair). More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getSupportSet (const ShapeBase *shape, const Vec3f &dir, SupportSet &support_set, int &hint, size_t num_sampled_supports=6, FCL_REAL tol=1e-3)
 Same as getSupportSet(const ShapeBase*, const FCL_REAL, SupportSet&, const int) but also constructs the support set frame from dir. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupportSet (const TriangleP *triangle, SupportSet &support_set, int &, ShapeSupportData &, size_t num_sampled_supports=6, FCL_REAL tol=1e-3)
 Triangle support set function. Assumes the support set frame has already been computed. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupportSet (const Box *box, SupportSet &support_set, int &, ShapeSupportData &support_data, size_t num_sampled_supports=6, FCL_REAL tol=1e-3)
 Box support set function. Assumes the support set frame has already been computed. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupportSet (const Sphere *sphere, SupportSet &support_set, int &, ShapeSupportData &, size_t num_sampled_supports=6, FCL_REAL tol=1e-3)
 Sphere support set function. Assumes the support set frame has already been computed. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupportSet (const Ellipsoid *ellipsoid, SupportSet &support_set, int &, ShapeSupportData &, size_t num_sampled_supports=6, FCL_REAL tol=1e-3)
 Ellipsoid support set function. Assumes the support set frame has already been computed. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupportSet (const Capsule *capsule, SupportSet &support_set, int &, ShapeSupportData &, size_t num_sampled_supports=6, FCL_REAL tol=1e-3)
 Capsule support set function. Assumes the support set frame has already been computed. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupportSet (const Cone *cone, SupportSet &support_set, int &, ShapeSupportData &, size_t num_sampled_supports=6, FCL_REAL tol=1e-3)
 Cone support set function. Assumes the support set frame has already been computed. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupportSet (const Cylinder *cylinder, SupportSet &support_set, int &, ShapeSupportData &, size_t num_sampled_supports=6, FCL_REAL tol=1e-3)
 Cylinder support set function. Assumes the support set frame has already been computed. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupportSet (const ConvexBase *convex, SupportSet &support_set, int &hint, ShapeSupportData &support_data, size_t num_sampled_supports=6, FCL_REAL tol=1e-3)
 ConvexBase support set function. Assumes the support set frame has already been computed. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupportSet (const SmallConvex *convex, SupportSet &support_set, int &, ShapeSupportData &, size_t num_sampled_supports=6, FCL_REAL tol=1e-3)
 Support set function for large ConvexBase (>32 vertices). Assumes the support set frame has already been computed. More...
 
template<int _SupportOptions = SupportOptions::NoSweptSphere>
void getShapeSupportSet (const LargeConvex *convex, SupportSet &support_set, int &hint, ShapeSupportData &support_data, size_t num_sampled_supports=6, FCL_REAL tol=1e-3)
 Support set function for small ConvexBase (<32 vertices). Assumes the support set frame has already been computed. More...
 
void computeSupportSetConvexHull (SupportSet::Polygon &cloud, SupportSet::Polygon &cvx_hull)
 Computes the convex-hull of support_set. For now, this function is only needed for Box and ConvexBase. More...
 
FCL_REAL sphereCapsuleDistance (const Sphere &s1, const Transform3f &tf1, const Capsule &s2, const Transform3f &tf2, Vec3f &p1, Vec3f &p2, Vec3f &normal)
 
FCL_REAL sphereCylinderDistance (const Sphere &s1, const Transform3f &tf1, const Cylinder &s2, const Transform3f &tf2, Vec3f &p1, Vec3f &p2, Vec3f &normal)
 
FCL_REAL sphereSphereDistance (const Sphere &s1, const Transform3f &tf1, const Sphere &s2, const Transform3f &tf2, Vec3f &p1, Vec3f &p2, Vec3f &normal)
 
FCL_REAL segmentSqrDistance (const Vec3f &from, const Vec3f &to, const Vec3f &p, Vec3f &nearest)
 the minimum distance from a point to a line More...
 
bool projectInTriangle (const Vec3f &p1, const Vec3f &p2, const Vec3f &p3, const Vec3f &normal, const Vec3f &p)
 Whether a point's projection is in a triangle. More...
 
FCL_REAL sphereTriangleDistance (const Sphere &s, const Transform3f &tf1, const TriangleP &tri, const Transform3f &tf2, Vec3f &p1, Vec3f &p2, Vec3f &normal)
 
FCL_REAL halfspaceDistance (const Halfspace &h, const Transform3f &tf1, const ShapeBase &s, const Transform3f &tf2, Vec3f &p1, Vec3f &p2, Vec3f &normal)
 
FCL_REAL planeDistance (const Plane &plane, const Transform3f &tf1, const ShapeBase &s, const Transform3f &tf2, Vec3f &p1, Vec3f &p2, Vec3f &normal)
 
FCL_REAL boxSphereDistance (const Box &b, const Transform3f &tfb, const Sphere &s, const Transform3f &tfs, Vec3f &pb, Vec3f &ps, Vec3f &normal)
 
FCL_REAL halfspaceHalfspaceDistance (const Halfspace &s1, const Transform3f &tf1, const Halfspace &s2, const Transform3f &tf2, Vec3f &p1, Vec3f &p2, Vec3f &normal)
 return distance between two halfspaces More...
 
FCL_REAL halfspacePlaneDistance (const Halfspace &s1, const Transform3f &tf1, const Plane &s2, const Transform3f &tf2, Vec3f &p1, Vec3f &p2, Vec3f &normal)
 return distance between plane and halfspace. More...
 
FCL_REAL planePlaneDistance (const Plane &s1, const Transform3f &tf1, const Plane &s2, const Transform3f &tf2, Vec3f &p1, Vec3f &p2, Vec3f &normal)
 return distance between two planes More...
 
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. More...
 
FCL_REAL computePenetration (const Vec3f &P1, const Vec3f &P2, const Vec3f &P3, const Vec3f &Q1, const Vec3f &Q2, const Vec3f &Q3, const Transform3f &tf1, const Transform3f &tf2, Vec3f &normal)
 

Enumeration Type Documentation

◆ SupportOptions

Options for the computation of support points. NoSweptSphere option is used when the support function is called by GJK or EPA. In this case, the swept sphere radius is not taken into account in the support function. It is used by GJK and EPA after they have converged to correct the solution. WithSweptSphere option is used when the support function is called directly by the user. In this case, the swept sphere radius is taken into account in the support function.

Enumerator
NoSweptSphere 
WithSweptSphere 

Function Documentation

◆ boxSphereDistance()

FCL_REAL hpp::fcl::details::boxSphereDistance ( const Box b,
const Transform3f tfb,
const Sphere s,
const Transform3f tfs,
Vec3f pb,
Vec3f ps,
Vec3f normal 
)
inline

Taken from book Real Time Collision Detection, from Christer Ericson

Parameters
pbthe witness point on the box surface
psthe witness point on the sphere.
normalpointing from box to sphere
Returns
the distance between the two shapes (negative if penetration).

◆ computePenetration() [1/2]

FCL_REAL hpp::fcl::details::computePenetration ( const Vec3f P1,
const Vec3f P2,
const Vec3f P3,
const Vec3f Q1,
const Vec3f Q2,
const Vec3f Q3,
const Transform3f tf1,
const Transform3f tf2,
Vec3f normal 
)
inline

◆ computePenetration() [2/2]

FCL_REAL hpp::fcl::details::computePenetration ( const Vec3f P1,
const Vec3f P2,
const Vec3f P3,
const Vec3f Q1,
const Vec3f Q2,
const Vec3f Q3,
Vec3f normal 
)
inline

See the prototype below.

◆ computeSupportSetConvexHull()

void hpp::fcl::details::computeSupportSetConvexHull ( SupportSet::Polygon cloud,
SupportSet::Polygon cvx_hull 
)

Computes the convex-hull of support_set. For now, this function is only needed for Box and ConvexBase.

Parameters
[in]clouddata which contains the 2d points of the support set which convex-hull we want to compute.
[out]2dpoints of the the support set's convex-hull.

◆ getShapeSupport() [1/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupport ( const Box box,
const Vec3f dir,
Vec3f support,
int &  ,
ShapeSupportData  
)

Box support function.

◆ getShapeSupport() [2/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupport ( const Capsule capsule,
const Vec3f dir,
Vec3f support,
int &  ,
ShapeSupportData  
)

Capsule support function.

◆ getShapeSupport() [3/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupport ( const Cone cone,
const Vec3f dir,
Vec3f support,
int &  ,
ShapeSupportData  
)

Cone support function.

◆ getShapeSupport() [4/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupport ( const ConvexBase convex,
const Vec3f dir,
Vec3f support,
int &  hint,
ShapeSupportData  
)

ConvexBase support function.

Note
See LargeConvex and SmallConvex to see how to optimize ConvexBase's support computation.

◆ getShapeSupport() [5/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupport ( const Cylinder cylinder,
const Vec3f dir,
Vec3f support,
int &  ,
ShapeSupportData  
)

Cylinder support function.

◆ getShapeSupport() [6/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupport ( const Ellipsoid ellipsoid,
const Vec3f dir,
Vec3f support,
int &  ,
ShapeSupportData  
)

Ellipsoid support function.

◆ getShapeSupport() [7/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupport ( const LargeConvex convex,
const Vec3f dir,
Vec3f support,
int &  hint,
ShapeSupportData support_data 
)

Support function for small ConvexBase (<32 vertices).

◆ getShapeSupport() [8/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupport ( const SmallConvex convex,
const Vec3f dir,
Vec3f support,
int &  hint,
ShapeSupportData data 
)

Support function for large ConvexBase (>32 vertices).

◆ getShapeSupport() [9/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupport ( const Sphere sphere,
const Vec3f dir,
Vec3f support,
int &  ,
ShapeSupportData  
)

Sphere support function.

◆ getShapeSupport() [10/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupport ( const TriangleP triangle,
const Vec3f dir,
Vec3f support,
int &  ,
ShapeSupportData  
)

Triangle support function.

◆ getShapeSupportSet() [1/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupportSet ( const Box box,
SupportSet support_set,
int &  ,
ShapeSupportData support_data,
size_t  num_sampled_supports = 6,
FCL_REAL  tol = 1e-3 
)

Box support set function. Assumes the support set frame has already been computed.

◆ getShapeSupportSet() [2/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupportSet ( const Capsule capsule,
SupportSet support_set,
int &  ,
ShapeSupportData ,
size_t  num_sampled_supports = 6,
FCL_REAL  tol = 1e-3 
)

Capsule support set function. Assumes the support set frame has already been computed.

◆ getShapeSupportSet() [3/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupportSet ( const Cone cone,
SupportSet support_set,
int &  ,
ShapeSupportData ,
size_t  num_sampled_supports = 6,
FCL_REAL  tol = 1e-3 
)

Cone support set function. Assumes the support set frame has already been computed.

◆ getShapeSupportSet() [4/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupportSet ( const ConvexBase convex,
SupportSet support_set,
int &  hint,
ShapeSupportData support_data,
size_t  num_sampled_supports = 6,
FCL_REAL  tol = 1e-3 
)

ConvexBase support set function. Assumes the support set frame has already been computed.

Note
See LargeConvex and SmallConvex to see how to optimize ConvexBase's support computation.

◆ getShapeSupportSet() [5/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupportSet ( const Cylinder cylinder,
SupportSet support_set,
int &  ,
ShapeSupportData ,
size_t  num_sampled_supports = 6,
FCL_REAL  tol = 1e-3 
)

Cylinder support set function. Assumes the support set frame has already been computed.

◆ getShapeSupportSet() [6/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupportSet ( const Ellipsoid ellipsoid,
SupportSet support_set,
int &  ,
ShapeSupportData ,
size_t  num_sampled_supports = 6,
FCL_REAL  tol = 1e-3 
)

Ellipsoid support set function. Assumes the support set frame has already been computed.

◆ getShapeSupportSet() [7/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupportSet ( const LargeConvex convex,
SupportSet support_set,
int &  hint,
ShapeSupportData support_data,
size_t  num_sampled_supports = 6,
FCL_REAL  tol = 1e-3 
)

Support set function for small ConvexBase (<32 vertices). Assumes the support set frame has already been computed.

◆ getShapeSupportSet() [8/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupportSet ( const SmallConvex convex,
SupportSet support_set,
int &  ,
ShapeSupportData ,
size_t  num_sampled_supports = 6,
FCL_REAL  tol = 1e-3 
)

Support set function for large ConvexBase (>32 vertices). Assumes the support set frame has already been computed.

◆ getShapeSupportSet() [9/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupportSet ( const Sphere sphere,
SupportSet support_set,
int &  ,
ShapeSupportData ,
size_t  num_sampled_supports = 6,
FCL_REAL  tol = 1e-3 
)

Sphere support set function. Assumes the support set frame has already been computed.

◆ getShapeSupportSet() [10/10]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getShapeSupportSet ( const TriangleP triangle,
SupportSet support_set,
int &  ,
ShapeSupportData ,
size_t  num_sampled_supports = 6,
FCL_REAL  tol = 1e-3 
)

Triangle support set function. Assumes the support set frame has already been computed.

◆ getSupport()

template<int _SupportOptions = SupportOptions::NoSweptSphere>
Vec3f hpp::fcl::details::getSupport ( const ShapeBase shape,
const Vec3f dir,
int &  hint 
)

the support function for shape. The output support point is expressed in the local frame of the shape.

Returns
a point which belongs to the set {argmax_{v in shape} v.dot(dir)}.
Parameters
shapethe shape.
dirsupport direction.
hintused to initialize the search when shape is a ConvexBase object.
Template Parameters
SupportOptionsis a value of the SupportOptions enum. If set to WithSweptSphere, the support functions take into account the shapes' swept sphere radii. Please see MinkowskiDiff::set(const ShapeBase*, const ShapeBase*) for more details.

◆ getSupportSet() [1/2]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getSupportSet ( const ShapeBase shape,
const Vec3f dir,
SupportSet support_set,
int &  hint,
size_t  num_sampled_supports = 6,
FCL_REAL  tol = 1e-3 
)

Same as getSupportSet(const ShapeBase*, const FCL_REAL, SupportSet&, const int) but also constructs the support set frame from dir.

Note
The support direction dir is expressed in the local frame of the shape.
This function automatically deals with the direction of the SupportSet.

◆ getSupportSet() [2/2]

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void hpp::fcl::details::getSupportSet ( const ShapeBase shape,
SupportSet support_set,
int &  hint,
size_t  num_sampled_supports = 6,
FCL_REAL  tol = 1e-3 
)

Computes the support set for shape. This function assumes the frame of the support set has already been computed and that this frame is expressed w.r.t the local frame of the shape (i.e. the local frame of the shape is the WORLD frame of the support set). The support direction used to compute the support set is the positive z-axis if the support set has the DEFAULT direction; negative z-axis if it has the INVERTED direction. (In short, a shape's support set is has the DEFAULT direction if the shape is the first shape in a collision pair. It has the INVERTED direction if the shape is the second one in the collision pair).

Returns
an approximation of the set {argmax_{v in shape} v.dot(dir)}, where dir is the support set's support direction. The support set is a plane passing by the origin of the support set frame and supported by the direction dir. As a consequence, any point added to the set is automatically projected onto this plane.
Parameters
[in]shapethe shape.
[in/out]support_set of shape.
[in/out]hint used to initialize the search when shape is a ConvexBase object.
[in]num_sampled_supportsis only used for shapes with smooth non-strictly convex bases like cones and cylinders (their bases are circles). In such a case, if the support direction points to their base, we have to choose which points we want to add to the set. This is not needed for boxes or ConvexBase for example. Indeed, because their support sets are always polygons, we can characterize the entire support set with the vertices of the polygon.
[in]tolgiven a point v on the shape, if max_{p in shape}(p.dot(dir)) - v.dot(dir) <= tol, where dir is the set's support direction, then v is added to the support set. Otherwise said, if a point p of the shape is at a distance tol from the support plane, it is added to the set. Thus, tol can be seen as the "thickness" of the support plane.
Template Parameters
SupportOptionsis a value of the SupportOptions enum. If set to WithSweptSphere, the support functions take into account the shapes' swept sphere radii.

◆ halfspaceDistance()

FCL_REAL hpp::fcl::details::halfspaceDistance ( const Halfspace h,
const Transform3f tf1,
const ShapeBase s,
const Transform3f tf2,
Vec3f p1,
Vec3f p2,
Vec3f normal 
)
inline
Parameters
p1closest (or most penetrating) point on the Halfspace,
p2closest (or most penetrating) point on the shape,
normalthe halfspace normal.
Returns
the distance between the two shapes (negative if penetration).

◆ halfspaceHalfspaceDistance()

FCL_REAL hpp::fcl::details::halfspaceHalfspaceDistance ( const Halfspace s1,
const Transform3f tf1,
const Halfspace s2,
const Transform3f tf2,
Vec3f p1,
Vec3f p2,
Vec3f normal 
)
inline

return distance between two halfspaces

Parameters
p1the witness point on the first halfspace.
p2the witness point on the second halfspace.
normalpointing from first to second halfspace.
Returns
the distance between the two shapes (negative if penetration).
Note
If the two halfspaces don't have the same normal (or opposed normals), they collide and their distance is set to -infinity as there is no translation that can separate them; they have infinite penetration depth. The points p1 and p2 are the same point and represent the origin of the intersection line between the objects. The normal is the direction of this line.

◆ halfspacePlaneDistance()

FCL_REAL hpp::fcl::details::halfspacePlaneDistance ( const Halfspace s1,
const Transform3f tf1,
const Plane s2,
const Transform3f tf2,
Vec3f p1,
Vec3f p2,
Vec3f normal 
)
inline

return distance between plane and halfspace.

Parameters
p1the witness point on the halfspace.
p2the witness point on the plane.
normalpointing from halfspace to plane.
Returns
the distance between the two shapes (negative if penetration).
Note
If plane and halfspace don't have the same normal (or opposed normals), they collide and their distance is set to -infinity as there is no translation that can separate them; they have infinite penetration depth. The points p1 and p2 are the same point and represent the origin of the intersection line between the objects. The normal is the direction of this line.

◆ planeDistance()

FCL_REAL hpp::fcl::details::planeDistance ( const Plane plane,
const Transform3f tf1,
const ShapeBase s,
const Transform3f tf2,
Vec3f p1,
Vec3f p2,
Vec3f normal 
)
inline
Parameters
p1closest (or most penetrating) point on the Plane,
p2closest (or most penetrating) point on the shape,
normalthe halfspace normal.
Returns
the distance between the two shapes (negative if penetration).

◆ planePlaneDistance()

FCL_REAL hpp::fcl::details::planePlaneDistance ( const Plane s1,
const Transform3f tf1,
const Plane s2,
const Transform3f tf2,
Vec3f p1,
Vec3f p2,
Vec3f normal 
)
inline

return distance between two planes

Parameters
p1the witness point on the first plane.
p2the witness point on the second plane.
normalpointing from first to second plane.
Returns
the distance between the two shapes (negative if penetration).
Note
If the two planes don't have the same normal (or opposed normals), they collide and their distance is set to -infinity as there is no translation that can separate them; they have infinite penetration depth. The points p1 and p2 are the same point and represent the origin of the intersection line between the objects. The normal is the direction of this line.

◆ projectInTriangle()

bool hpp::fcl::details::projectInTriangle ( const Vec3f p1,
const Vec3f p2,
const Vec3f p3,
const Vec3f normal,
const Vec3f p 
)
inline

Whether a point's projection is in a triangle.

◆ segmentSqrDistance()

FCL_REAL hpp::fcl::details::segmentSqrDistance ( const Vec3f from,
const Vec3f to,
const Vec3f p,
Vec3f nearest 
)
inline

the minimum distance from a point to a line

◆ sphereCapsuleDistance()

FCL_REAL hpp::fcl::details::sphereCapsuleDistance ( const Sphere s1,
const Transform3f tf1,
const Capsule s2,
const Transform3f tf2,
Vec3f p1,
Vec3f p2,
Vec3f normal 
)
inline
Parameters
p1witness point on the Sphere.
p2witness point on the Capsule.
normalpointing from shape 1 to shape 2 (sphere to capsule).
Returns
the distance between the two shapes (negative if penetration).

◆ sphereCylinderDistance()

FCL_REAL hpp::fcl::details::sphereCylinderDistance ( const Sphere s1,
const Transform3f tf1,
const Cylinder s2,
const Transform3f tf2,
Vec3f p1,
Vec3f p2,
Vec3f normal 
)
inline
Parameters
p1witness point on the Sphere.
p2witness point on the Cylinder.
normalpointing from shape 1 to shape 2 (sphere to cylinder).
Returns
the distance between the two shapes (negative if penetration).
Todo:
a tiny performance improvement could be achieved using the abscissa with S as the origin

◆ sphereSphereDistance()

FCL_REAL hpp::fcl::details::sphereSphereDistance ( const Sphere s1,
const Transform3f tf1,
const Sphere s2,
const Transform3f tf2,
Vec3f p1,
Vec3f p2,
Vec3f normal 
)
inline
Parameters
p1witness point on the first Sphere.
p2witness point on the second Sphere.
normalpointing from shape 1 to shape 2 (sphere1 to sphere2).
Returns
the distance between the two spheres (negative if penetration).

◆ sphereTriangleDistance()

FCL_REAL hpp::fcl::details::sphereTriangleDistance ( const Sphere s,
const Transform3f tf1,
const TriangleP tri,
const Transform3f tf2,
Vec3f p1,
Vec3f p2,
Vec3f normal 
)
inline
Parameters
p1witness point on the first Sphere.
p2witness point on the second Sphere.
normalpointing from shape 1 to shape 2 (sphere1 to sphere2).
Returns
the distance between the two shapes (negative if penetration).