38 #ifndef HPP_FCL_BROADPHASE_BROADPAHSESPATIALHASH_H 39 #define HPP_FCL_BROADPHASE_BROADPAHSESPATIALHASH_H 53 template <
typename HashTable = detail::SimpleHashTable<AABB, CollisionObject*,
54 detail::SpatialHash> >
61 const Vec3f& scene_max,
62 unsigned int default_table_size = 1000);
79 void update(CollisionObject* updated_obj);
82 void update(
const std::vector<CollisionObject*>& updated_objs);
135 std::list<CollisionObject*>
objs;
158 template <
typename Container>
bool distanceObjectToObjects(CollisionObject *obj, const Container &objs, DistanceCallBackBase *callback, FCL_REAL &min_dist) const
void setup()
initialize the manager, related with the specific type of manager
Base class for broad phase collision. It helps to accelerate the collision/distance between N objects...
Base callback class for collision queries. This class can be supersed by child classes to provide des...
void clear()
clear the manager
static void computeBound(std::vector< CollisionObject *> &objs, Vec3f &l, Vec3f &u)
compute the bound for the environent
SpatialHashingCollisionManager(FCL_REAL cell_size, const Vec3f &scene_min, const Vec3f &scene_max, unsigned int default_table_size=1000)
spatial hashing collision mananger
virtual void update()
update the condition of manager
size_t size() const
the number of objects managed by the manager
void distance(CollisionObject *obj, DistanceCallBackBase *callback) const
perform distance computation between one object and all the objects belonging ot the manager ...
std::list< CollisionObject * > objs_partially_penetrating_scene_limit
objects partially penetrating (not totally inside nor outside) the scene limit are in another list ...
virtual std::vector< CollisionObject * > getObjects() const
return the objects managed by the manager
bool empty() const
whether the manager is empty
AABB scene_limit
the size of the scene
bool distance_(CollisionObject *obj, DistanceCallBackBase *callback, FCL_REAL &min_dist) const
perform distance computation between one object and all the objects belonging ot the manager ...
std::list< CollisionObject * > objs_outside_scene_limit
objects outside the scene limit are in another list
void unregisterObject(CollisionObject *obj)
remove one object from the manager
HashTable * hash_table
objects in the scene limit (given by scene_min and scene_max) are in the spatial hash table ...
std::list< CollisionObject * > objs
all objects in the scene
~SpatialHashingCollisionManager()
bool collide_(CollisionObject *obj, CollisionCallBackBase *callback) const
perform collision test between one object and all the objects belonging to the manager ...
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
Base callback class for distance queries. This class can be supersed by child classes to provide desi...
BroadPhaseCollisionManager Base
void collide(CollisionObject *obj, CollisionCallBackBase *callback) const
perform collision test between one object and all the objects belonging to the manager ...
std::map< CollisionObject *, AABB > obj_aabb_map
store the map between objects and their aabbs. will make update more convenient
void registerObject(CollisionObject *obj)
add one object to the manager