Go to the documentation of this file.
   38 #ifndef FCL_BROAD_PHASE_BRUTE_FORCE_INL_H 
   39 #define FCL_BROAD_PHASE_BRUTE_FORCE_INL_H 
   62   std::copy(other_objs.begin(), other_objs.end(), std::back_inserter(objs));
 
  101 template <
typename S>
 
  104   objs_.resize(objs.size());
 
  105   std::copy(objs.begin(), objs.end(), objs_.begin());
 
  109 template <
typename S>
 
  112   if(size() == 0) 
return;
 
  114   for(
auto* 
obj2 : objs)
 
  122 template <
typename S>
 
  125   if(size() == 0) 
return;
 
  128   for(
auto* 
obj2 : objs)
 
  130     if(
obj->getAABB().distance(
obj2->getAABB()) < min_dist)
 
  132       if(callback(
obj, 
obj2, cdata, min_dist))
 
  139 template <
typename S>
 
  142   if(size() == 0) 
return;
 
  144   for(
typename std::list<
CollisionObject<S>*>::const_iterator it1 = objs.begin(), end = objs.end();
 
  147     typename std::list<CollisionObject<S>*>::const_iterator it2 = it1; it2++;
 
  148     for(; it2 != end; ++it2)
 
  150       if((*it1)->getAABB().overlap((*it2)->getAABB()))
 
  152         if(callback(*it1, *it2, cdata))
 
  160 template <
typename S>
 
  163   if(size() == 0) 
return;
 
  166   for(
typename std::list<
CollisionObject<S>*>::const_iterator it1 = objs.begin(), end = objs.end(); it1 != end; ++it1)
 
  168     typename std::list<CollisionObject<S>*>::const_iterator it2 = it1; it2++;
 
  169     for(; it2 != end; ++it2)
 
  171       if((*it1)->getAABB().distance((*it2)->getAABB()) < min_dist)
 
  173         if(callback(*it1, *it2, cdata, min_dist))
 
  181 template <
typename S>
 
  186   if((size() == 0) || (other_manager->
size() == 0)) 
return;
 
  188   if(
this == other_manager)
 
  194   for(
auto* 
obj1 : objs)
 
  196     for(
auto* 
obj2 : other_manager->
objs)
 
  198       if(
obj1->getAABB().overlap(
obj2->getAABB()))
 
  208 template <
typename S>
 
  213   if((size() == 0) || (other_manager->
size() == 0)) 
return;
 
  215   if(
this == other_manager)
 
  222   for(
auto* 
obj1 : objs)
 
  224     for(
auto* 
obj2 : other_manager->
objs)
 
  226       if(
obj1->getAABB().distance(
obj2->getAABB()) < min_dist)
 
  228         if(callback(
obj1, 
obj2, cdata, min_dist))
 
  236 template <
typename S>
 
  243 template <
typename S>
 
  
CollisionObject< S > * obj2
Brute force N-body collision manager.
S distance(const Eigen::MatrixBase< DerivedA > &R0, const Eigen::MatrixBase< DerivedB > &T0, const kIOS< S > &b1, const kIOS< S > &b2, Vector3< S > *P, Vector3< S > *Q)
Approximate distance between two kIOS bounding volumes.
void registerObject(CollisionObject< S > *obj)
add one object to the manager
void getObjects(std::vector< CollisionObject< S > * > &objs) const
return the objects managed by the manager
CollisionObject< S > * obj1
CollisionObject< S > * obj
object
bool(*)(CollisionObject< S > *o1, CollisionObject< S > *o2, void *cdata, S &dist) DistanceCallBack
Callback for distance between two objects, Return value is whether can stop now, also return the mini...
void collide(CollisionObject< S > *obj, void *cdata, CollisionCallBack< S > callback) const
perform collision test between one object and all the objects belonging to the manager
bool(*)(CollisionObject< S > *o1, CollisionObject< S > *o2, void *cdata) CollisionCallBack
Callback for collision between two objects. Return value is whether can stop now.
void update()
update the condition of manager
void clear()
clear the manager
void distance(CollisionObject< S > *obj, void *cdata, DistanceCallBack< S > callback) const
perform distance computation between one object and all the objects belonging to the manager
void unregisterObject(CollisionObject< S > *obj)
remove one object from the manager
void registerObjects(const std::vector< CollisionObject< S > * > &other_objs)
add objects to the manager
template FCL_EXPORT std::size_t collide(const CollisionObject< double > *o1, const CollisionObject< double > *o2, const CollisionRequest< double > &request, CollisionResult< double > &result)
void setup()
initialize the manager, related with the specific type of manager
std::list< CollisionObject< S > * > objs
objects belonging to the manager are stored in a list structure
bool empty() const
whether the manager is empty
size_t size() const
the number of objects managed by the manager
the object for collision or distance computation, contains the geometry and the transform information
Base class for broad phase collision. It helps to accelerate the collision/distance between N objects...
fcl
Author(s): 
autogenerated on Fri Mar 14 2025 02:38:17