38 #ifndef FCL_COLLISION_GEOMETRY_INL_H 39 #define FCL_COLLISION_GEOMETRY_INL_H 41 #include "fcl/geometry/collision_geometry.h" 48 class CollisionGeometry<double>;
52 CollisionGeometry<S>::CollisionGeometry()
53 : aabb_center(Vector3<S>::Zero()),
57 threshold_occupied((S)1),
65 CollisionGeometry<S>::~CollisionGeometry()
102 return cost_density >= threshold_occupied;
106 template <
typename S>
109 return cost_density <= threshold_free;
113 template <
typename S>
116 return !isOccupied() && !isFree();
120 template <
typename S>
123 return Vector3<S>::Zero();
127 template <
typename S>
130 return Matrix3<S>::Zero();
134 template <
typename S>
141 template <
typename S>
144 Matrix3<S> C = computeMomentofInertia();
145 Vector3<S> com = computeCOM();
146 S V = computeVolume();
149 m << C(0, 0) - V * (com[1] * com[1] + com[2] * com[2]),
150 C(0, 1) + V * com[0] * com[1],
151 C(0, 2) + V * com[0] * com[2],
152 C(1, 0) + V * com[1] * com[0],
153 C(1, 1) - V * (com[0] * com[0] + com[2] * com[2]),
154 C(1, 2) + V * com[1] * com[2],
155 C(2, 0) + V * com[2] * com[0],
156 C(2, 1) + V * com[2] * com[1],
157 C(2, 2) - V * (com[0] * com[0] + com[1] * com[1]);
virtual Vector3< S > computeCOM() const
compute center of mass
Definition: collision_geometry-inl.h:121
virtual OBJECT_TYPE getObjectType() const
get the type of the object
Definition: collision_geometry-inl.h:72
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
virtual Matrix3< S > computeMomentofInertia() const
compute the inertia matrix, related to the origin
Definition: collision_geometry-inl.h:128
void * getUserData() const
get user data in geometry
Definition: collision_geometry-inl.h:86
bool isFree() const
whether the object is completely free
Definition: collision_geometry-inl.h:107
bool isUncertain() const
whether the object has some uncertainty
Definition: collision_geometry-inl.h:114
OBJECT_TYPE
object type: BVH (mesh, points), basic geometry, octree
Definition: collision_geometry.h:51
void setUserData(void *data)
set user data in geometry
Definition: collision_geometry-inl.h:93
virtual S computeVolume() const
compute the volume
Definition: collision_geometry-inl.h:135
virtual NODE_TYPE getNodeType() const
get the node type
Definition: collision_geometry-inl.h:79
bool isOccupied() const
whether the object is completely occupied
Definition: collision_geometry-inl.h:100
virtual Matrix3< S > computeMomentofInertiaRelatedToCOM() const
compute the inertia matrix, related to the com
Definition: collision_geometry-inl.h:142