38 #ifndef FCL_SHAPE_BOX_INL_H 39 #define FCL_SHAPE_BOX_INL_H 105 template <
typename S>
114 Vector3<S> I((b2 + c2) / 12, (a2 + c2) / 12, (a2 + b2) / 12);
116 return I.asDiagonal();
120 template <
typename S>
124 std::vector<Vector3<S>> result(8);
125 auto a =
side[0] / 2;
126 auto b =
side[1] / 2;
127 auto c =
side[2] / 2;
141 template <
typename S>
144 std::stringstream ss;
145 ss << std::setprecision(precision);
146 ss <<
"Box<" << S_str <<
">(" <<
side[0] <<
", " <<
side[1] <<
", " <<
side[2]
Vector3< S_ > aabb_center
AABB center in local coordinate.
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
std::string representation(int precision=20) const
Create a string that should be sufficient to recreate this shape. This is akin to the repr() implemen...
Base class for all basic geometric shapes.
S_ aabb_radius
AABB radius.
static const char * value()
Eigen::Transform< S, 3, Eigen::Isometry > Transform3
void computeLocalAABB() override
Compute AABB.
S computeVolume() const override
compute the volume
Eigen::Matrix< S, 3, 3 > Matrix3
Matrix3< S > computeMomentofInertia() const override
compute the inertia matrix, related to the origin
Eigen::Matrix< S, 3, 1 > Vector3
NODE_TYPE getNodeType() const override
Get node type: a box.
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 ...
Vector3< S > side
box side length
AABB< S_ > aabb_local
AABB in local coordinate, used for tight AABB when only translation transform.
template class FCL_EXPORT Box< double >