38 #ifndef FCL_SHAPE_CYLINDER_INL_H 39 #define FCL_SHAPE_CYLINDER_INL_H 41 #include "fcl/geometry/shape/cylinder.h" 48 class Cylinder<double>;
92 return Vector3<S>(ix, ix, iz).asDiagonal();
98 const Transform3<S>& tf)
const 100 std::vector<Vector3<S>> result(12);
103 auto r2 =
radius * 2 / std::sqrt(3.0);
107 result[0] = tf * Vector3<S>(r2, 0, -hl);
108 result[1] = tf * Vector3<S>(a, b, -hl);
109 result[2] = tf * Vector3<S>(-a, b, -hl);
110 result[3] = tf * Vector3<S>(-r2, 0, -hl);
111 result[4] = tf * Vector3<S>(-a, -b, -hl);
112 result[5] = tf * Vector3<S>(a, -b, -hl);
114 result[6] = tf * Vector3<S>(r2, 0, hl);
115 result[7] = tf * Vector3<S>(a, b, hl);
116 result[8] = tf * Vector3<S>(-a, b, hl);
117 result[9] = tf * Vector3<S>(-r2, 0, hl);
118 result[10] = tf * Vector3<S>(-a, -b, hl);
119 result[11] = tf * Vector3<S>(a, -b, hl);
Vector3< S_ > aabb_center
AABB center in local coordinate.
Definition: collision_geometry.h:91
NODE_TYPE
traversal node type: bounding volume (AABB, OBB, RSS, kIOS, OBBRSS, KDOP16, KDOP18, kDOP24), basic shape (box, sphere, ellipsoid, capsule, cone, cylinder, convex, plane, halfspace, triangle), and octree
Definition: collision_geometry.h:54
Main namespace.
Definition: broadphase_bruteforce-inl.h:45
Base class for all basic geometric shapes.
Definition: shape_base.h:48
Cylinder(S radius, S lz)
Constructor.
Definition: cylinder-inl.h:52
S computeVolume() const override
compute the volume
Definition: cylinder-inl.h:79
S_ aabb_radius
AABB radius.
Definition: collision_geometry.h:94
S radius
Radius of the cylinder.
Definition: cylinder.h:58
Matrix3< S > computeMomentofInertia() const override
compute the inertia matrix, related to the origin
Definition: cylinder-inl.h:86
void computeLocalAABB() override
Compute AABB.
Definition: cylinder-inl.h:60
S lz
Length along z axis.
Definition: cylinder.h:61
static constexpr S pi()
The mathematical constant pi.
Definition: constants.h:49
AABB< S_ > aabb_local
AABB in local coordinate, used for tight AABB when only translation transform.
Definition: collision_geometry.h:97
NODE_TYPE getNodeType() const override
Get node type: a cylinder.
Definition: cylinder-inl.h:72
std::vector< Vector3< S > > getBoundVertices(const Transform3< S > &tf) const
get the vertices of some convex shape which can bound this shape in a specific configuration ...
Definition: cylinder-inl.h:97