38 #ifndef FCL_BROADPHASE_BROADPAHSESPATIALHASH_H 39 #define FCL_BROADPHASE_BROADPAHSESPATIALHASH_H 55 = detail::SimpleHashTable<AABB<S>, CollisionObject<S>*, detail::SpatialHash<S>> >
63 unsigned int default_table_size = 1000);
68 void registerObject(CollisionObject<S>*
obj);
71 void unregisterObject(CollisionObject<S>* obj);
80 void update(CollisionObject<S>* updated_obj);
83 void update(
const std::vector<CollisionObject<S>*>& updated_objs);
89 void getObjects(std::vector<CollisionObject<S>*>& objs)
const;
124 bool distance_(CollisionObject<S>* obj,
void* cdata,
DistanceCallBack<S> callback, S& min_dist)
const;
127 std::list<CollisionObject<S>*>
objs;
154 template <
typename Container>
155 bool distanceObjectToObjects(
156 CollisionObject<S>* obj,
157 const Container& objs,
164 template<
typename HashTable = detail::SimpleHashTable<AABB<
float>, CollisionObject<
float>*, detail::SpatialHash<
float>>>
167 template<
typename HashTable = detail::SimpleHashTable<AABB<
double>, CollisionObject<
double>*, detail::SpatialHash<
double>>>
std::list< CollisionObject< S > * > objs_outside_scene_limit
objects outside the scene limit are in another list
AABB< S > scene_limit
the size of the scene
std::map< CollisionObject< S > *, AABB< S > > obj_aabb_map
store the map between objects and their aabbs. will make update more convenient
spatial hashing collision mananger
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.
Eigen::Matrix< S, 3, 1 > Vector3
HashTable * hash_table
objects in the scene limit (given by scene_min and scene_max) are in the spatial hash table ...
bool(*)(CollisionObject< S > *o1, CollisionObject< S > *o2, void *cdata) CollisionCallBack
Callback for collision between two objects. Return value is whether can stop now. ...
template FCL_EXPORT std::size_t collide(const CollisionObject< double > *o1, const CollisionObject< double > *o2, const CollisionRequest< double > &request, CollisionResult< double > &result)
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...
std::list< CollisionObject< S > * > objs_partially_penetrating_scene_limit
objects partially penetrating (not totally inside nor outside) the scene limit are in another list ...
std::list< CollisionObject< S > * > objs
all objects in the scene
Base class for broad phase collision. It helps to accelerate the collision/distance between N objects...
CollisionObject< S > * obj
object