38 #ifndef FCL_COLLISION_OBJECT_INL_H 39 #define FCL_COLLISION_OBJECT_INL_H 41 #include "fcl/narrowphase/collision_object.h" 48 class CollisionObject<double>;
52 CollisionObject<S>::CollisionObject(
53 const std::shared_ptr<CollisionGeometry<S>>& cgeom_)
54 : cgeom(cgeom_), cgeom_const(cgeom_), t(Transform3<S>::Identity())
58 cgeom->computeLocalAABB();
65 CollisionObject<S>::CollisionObject(
66 const std::shared_ptr<CollisionGeometry<S>>& cgeom_,
67 const Transform3<S>& tf)
68 : cgeom(cgeom_), cgeom_const(cgeom_), t(tf)
70 cgeom->computeLocalAABB();
76 CollisionObject<S>::CollisionObject(
77 const std::shared_ptr<CollisionGeometry<S>>& cgeom_,
80 : cgeom(cgeom_), cgeom_const(cgeom_), t(Transform3<S>::Identity())
84 cgeom->computeLocalAABB();
90 CollisionObject<S>::~CollisionObject()
99 return cgeom->getObjectType();
103 template <
typename S>
106 return cgeom->getNodeType();
110 template <
typename S>
117 template <
typename S>
120 if(t.linear().isIdentity())
122 aabb =
translate(cgeom->aabb_local, t.translation());
126 Vector3<S> center = t * cgeom->aabb_center;
127 Vector3<S> delta = Vector3<S>::Constant(cgeom->aabb_radius);
128 aabb.min_ = center - delta;
129 aabb.max_ = center + delta;
134 template <
typename S>
141 template <
typename S>
148 template <
typename S>
151 return t.translation();
155 template <
typename S>
162 template <
typename S>
165 return Quaternion<S>(t.linear());
169 template <
typename S>
176 template <
typename S>
183 template <
typename S>
190 template <
typename S>
193 t.linear() = q.toRotationMatrix();
197 template <
typename S>
205 template <
typename S>
213 template <
typename S>
220 template <
typename S>
223 return t.matrix().isIdentity();
227 template <
typename S>
234 template <
typename S>
241 template <
typename S>
242 const std::shared_ptr<const CollisionGeometry<S>>&
249 template <
typename S>
252 return cgeom->cost_density;
256 template <
typename S>
259 cgeom->cost_density = c;
263 template <
typename S>
266 return cgeom->isOccupied();
270 template <
typename S>
273 return cgeom->isFree();
277 template <
typename S>
280 return cgeom->isUncertain();
NODE_TYPE getNodeType() const
get the node type
Definition: collision_object-inl.h:104
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
bool isFree() const
whether the object is completely free
Definition: collision_object-inl.h:271
void setRotation(const Matrix3< S > &R)
set object's rotation matrix
Definition: collision_object-inl.h:177
Main namespace.
Definition: broadphase_bruteforce-inl.h:45
bool isIdentityTransform() const
whether the object is in local coordinate
Definition: collision_object-inl.h:221
S getCostDensity() const
get object's cost density
Definition: collision_object-inl.h:250
void setQuatRotation(const Quaternion< S > &q)
set object's quatenrion rotation
Definition: collision_object-inl.h:191
AABB< S > translate(const AABB< S > &aabb, const Eigen::MatrixBase< Derived > &t)
translate the center of AABB by t
Definition: AABB-inl.h:345
const Matrix3< S > getRotation() const
get matrix rotation of the object
Definition: collision_object-inl.h:156
void setCostDensity(S c)
set object's cost density
Definition: collision_object-inl.h:257
void setTranslation(const Vector3< S > &T)
set object's translation
Definition: collision_object-inl.h:184
void setTransform(const Matrix3< S > &R, const Vector3< S > &T)
set object's transform
Definition: collision_object-inl.h:198
The geometry for the object for collision or distance computation.
Definition: collision_geometry.h:59
void setIdentityTransform()
set the object in local coordinate
Definition: collision_object-inl.h:228
void computeAABB()
compute the AABB in world space
Definition: collision_object-inl.h:118
OBJECT_TYPE
object type: BVH (mesh, points), basic geometry, octree
Definition: collision_geometry.h:51
const Transform3< S > & getTransform() const
get object's transform
Definition: collision_object-inl.h:170
const std::shared_ptr< const CollisionGeometry< S > > & collisionGeometry() const
get geometry from the object instance
Definition: collision_object-inl.h:243
const AABB< S > & getAABB() const
get the AABB in world space
Definition: collision_object-inl.h:111
bool isOccupied() const
whether the object is completely occupied
Definition: collision_object-inl.h:264
bool isUncertain() const
whether the object is uncertain
Definition: collision_object-inl.h:278
OBJECT_TYPE getObjectType() const
get the type of the object
Definition: collision_object-inl.h:97
const Quaternion< S > getQuatRotation() const
get quaternion rotation of the object
Definition: collision_object-inl.h:163
const Vector3< S > getTranslation() const
get translation of the object
Definition: collision_object-inl.h:149
void * getUserData() const
get user data in object
Definition: collision_object-inl.h:135
void setUserData(void *data)
set user data in object
Definition: collision_object-inl.h:142
FCL_DEPRECATED const CollisionGeometry< S > * getCollisionGeometry() const
get geometry from the object instance
Definition: collision_object-inl.h:235