38 #ifndef FCL_SHAPE_CAPSULE_INL_H
39 #define FCL_SHAPE_CAPSULE_INL_H
66 const Vector3<S> v_delta(radius, radius, 0.5 * lz + radius);
67 this->aabb_local.max_ = v_delta;
68 this->aabb_local.min_ = -v_delta;
70 this->aabb_center = this->aabb_local.center();
71 this->aabb_radius = (this->aabb_local.min_ - this->aabb_center).norm();
94 S r2 = radius * radius;
99 S ix = v_cyl * (l2 / 12. + r2 / 4.) + v_sph * (0.4 * r2 + 0.25 * l2 + 3. * radius * lz / 8.);
100 S iz = (0.5 * v_cyl + 0.4 * v_sph) * r2;
106 template <
typename S>
110 std::vector<Vector3<S>> result(36);
111 const auto m = (1 + std::sqrt(5.0)) / 2.0;
114 auto edge_size = radius * 6 / (std::sqrt(27.0) + std::sqrt(15.0));
116 auto b = m * edge_size;
117 auto r2 = radius * 2 / std::sqrt(3.0);
165 template <
typename S>
168 std::stringstream ss;
169 ss << std::setprecision(precision);
170 ss <<
"Capsule<" << S_str <<
">(" << radius <<
", " << lz <<
");";