38 #ifndef FCL_SHAPE_CONE_INL_H 39 #define FCL_SHAPE_CONE_INL_H 41 #include "fcl/geometry/shape/cone.h" 52 Cone<S>::Cone(S radius, S lz)
53 : ShapeBase<S>(), radius(radius), lz(lz)
92 return Vector3<S>(ix, ix, iz).asDiagonal();
99 return Vector3<S>(0, 0, -0.25 *
lz);
103 template <
typename S>
105 const Transform3<S>& tf)
const 107 std::vector<Vector3<S>> result(7);
110 auto r2 =
radius * 2 / std::sqrt(3.0);
114 result[0] = tf * Vector3<S>(r2, 0, -hl);
115 result[1] = tf * Vector3<S>(a, b, -hl);
116 result[2] = tf * Vector3<S>(-a, b, -hl);
117 result[3] = tf * Vector3<S>(-r2, 0, -hl);
118 result[4] = tf * Vector3<S>(-a, -b, -hl);
119 result[5] = tf * Vector3<S>(a, -b, -hl);
121 result[6] = tf * Vector3<S>(0, 0, hl);
Vector3< S_ > aabb_center
AABB center in local coordinate.
Definition: collision_geometry.h:91
S computeVolume() const override
compute the volume
Definition: cone-inl.h:79
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
S lz
Length along z axis.
Definition: capsule.h:61
S computeVolume() const override
compute the volume
Definition: capsule-inl.h:79
S_ aabb_radius
AABB radius.
Definition: collision_geometry.h:94
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: cone-inl.h:104
Vector3< S > computeCOM() const override
compute center of mass
Definition: cone-inl.h:97
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
void computeLocalAABB() override
Compute AABB.
Definition: cone-inl.h:60
Matrix3< S > computeMomentofInertia() const override
compute the inertia matrix, related to the origin
Definition: cone-inl.h:86
NODE_TYPE getNodeType() const override
Get node type: a cone.
Definition: cone-inl.h:72
S radius
Radius of capsule.
Definition: capsule.h:58