57 else if (num >= denom)
72 a_sd = a + s_n / s_d * d;
99 const fcl::Vec3f d1 = 2 * halfLength1 * tf1.getRotation().col(2);
100 const fcl::Vec3f d2 = 2 * halfLength2 * tf2.getRotation().col(2);
124 }
else if (e <= EPSILON) {
130 FCL_REAL denom = fmax(a * e - b * b, 0);
134 if (denom > EPSILON) {
135 s =
clamp((b * f - c * e), denom);
150 w2 = p2 + t / e * d2;
156 const Vec3f normal = (w1 - w2) / distance;
157 result.normal = normal;
160 distance = distance - (radius1 + radius2);
164 if (request.enable_nearest_points) {
165 result.nearest_points[0] = w1 - radius1 * normal;
166 result.nearest_points[1] = w2 + radius2 * normal;
request to the distance computation
FCL_REAL ShapeShapeDistance< Capsule, Capsule >(const CollisionGeometry *o1, const Transform3f &tf1, const CollisionGeometry *o2, const Transform3f &tf2, const GJKSolver *, const DistanceRequest &request, DistanceResult &result)
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.
void clamped_linear(Vec3f &a_sd, const Vec3f &a, const FCL_REAL &s_n, const FCL_REAL &s_d, const Vec3f &d)
Clamp s=s_n/s_d in [0, 1] and stores a + s * d in a_sd.
Capsule It is where is the distance between the point x and the capsule segment AB...
FCL_REAL clamp(const FCL_REAL &num, const FCL_REAL &denom)
Clamp num / denom in [0, 1].
collision and distance solver based on GJK algorithm implemented in fcl (rewritten the code from the ...
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
The geometry for the object for collision or distance computation.
FCL_REAL radius
Radius of capsule.
FCL_REAL halfLength
Half Length along z axis.