Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | List of all members
fcl::SpatialHashingCollisionManager< S, HashTable > Class Template Reference

spatial hashing collision mananger More...

#include <broadphase_spatialhash.h>

Inheritance diagram for fcl::SpatialHashingCollisionManager< S, HashTable >:
Inheritance graph
[legend]

Public Member Functions

void clear ()
 clear the manager More...
 
void collide (BroadPhaseCollisionManager< S > *other_manager, void *cdata, CollisionCallBack< S > callback) const
 perform collision test with objects belonging to another manager More...
 
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 More...
 
void collide (void *cdata, CollisionCallBack< S > callback) const
 perform collision test for the objects belonging to the manager (i.e, N^2 self collision) More...
 
void distance (BroadPhaseCollisionManager< S > *other_manager, void *cdata, DistanceCallBack< S > callback) const
 perform distance test with objects belonging to another manager More...
 
void distance (CollisionObject< S > *obj, void *cdata, DistanceCallBack< S > callback) const
 perform distance computation between one object and all the objects belonging ot the manager More...
 
void distance (void *cdata, DistanceCallBack< S > callback) const
 perform distance test for the objects belonging to the manager (i.e., N^2 self distance) More...
 
bool empty () const
 whether the manager is empty More...
 
void getObjects (std::vector< CollisionObject< S > * > &objs) const
 return the objects managed by the manager More...
 
void registerObject (CollisionObject< S > *obj)
 add one object to the manager More...
 
void setup ()
 initialize the manager, related with the specific type of manager More...
 
size_t size () const
 the number of objects managed by the manager More...
 
 SpatialHashingCollisionManager (S cell_size, const Vector3< S > &scene_min, const Vector3< S > &scene_max, unsigned int default_table_size=1000)
 
void unregisterObject (CollisionObject< S > *obj)
 remove one object from the manager More...
 
void update ()
 update the condition of manager More...
 
void update (CollisionObject< S > *updated_obj)
 update the manager by explicitly given the object updated More...
 
void update (const std::vector< CollisionObject< S > * > &updated_objs)
 update the manager by explicitly given the set of objects update More...
 
 ~SpatialHashingCollisionManager ()
 
- Public Member Functions inherited from fcl::BroadPhaseCollisionManager< S >
 BroadPhaseCollisionManager ()
 
virtual void registerObjects (const std::vector< CollisionObject< S > * > &other_objs)
 add objects to the manager More...
 
virtual ~BroadPhaseCollisionManager ()
 

Static Public Member Functions

static void computeBound (std::vector< CollisionObject< S > * > &objs, Vector3< S > &l, Vector3< S > &u)
 compute the bound for the environent More...
 

Protected Member Functions

bool collide_ (CollisionObject< S > *obj, void *cdata, CollisionCallBack< S > callback) const
 perform collision test between one object and all the objects belonging to the manager More...
 
bool distance_ (CollisionObject< S > *obj, void *cdata, DistanceCallBack< S > callback, S &min_dist) const
 perform distance computation between one object and all the objects belonging ot the manager More...
 
- Protected Member Functions inherited from fcl::BroadPhaseCollisionManager< S >
void insertTestedSet (CollisionObject< S > *a, CollisionObject< S > *b) const
 
bool inTestedSet (CollisionObject< S > *a, CollisionObject< S > *b) const
 

Protected Attributes

HashTable * hash_table
 objects in the scene limit (given by scene_min and scene_max) are in the spatial hash table More...
 
std::map< CollisionObject< S > *, AABB< S > > obj_aabb_map
 store the map between objects and their aabbs. will make update more convenient More...
 
std::list< CollisionObject< S > * > objs
 all objects in the scene More...
 
std::list< CollisionObject< S > * > objs_outside_scene_limit
 objects outside the scene limit are in another list More...
 
std::list< CollisionObject< S > * > objs_partially_penetrating_scene_limit
 objects partially penetrating (not totally inside nor outside) the scene limit are in another list More...
 
AABB< S > scene_limit
 the size of the scene More...
 
- Protected Attributes inherited from fcl::BroadPhaseCollisionManager< S >
bool enable_tested_set_
 
std::set< std::pair< CollisionObject< S > *, CollisionObject< S > * > > tested_set
 tools help to avoid repeating collision or distance callback for the pairs of objects tested before. It can be useful for some of the broadphase algorithms. More...
 

Private Types

enum  ObjectStatus { Inside, PartiallyPenetrating, Outside }
 

Private Member Functions

template<typename Container >
bool distanceObjectToObjects (CollisionObject< S > *obj, const Container &objs, void *cdata, DistanceCallBack< S > callback, S &min_dist) const
 

Detailed Description

template<typename S, typename HashTable = detail::SimpleHashTable<AABB<S>, CollisionObject<S>*, detail::SpatialHash<S>>>
class fcl::SpatialHashingCollisionManager< S, HashTable >

spatial hashing collision mananger

Definition at line 56 of file broadphase_spatialhash.h.

Member Enumeration Documentation

◆ ObjectStatus

template<typename S , typename HashTable = detail::SimpleHashTable<AABB<S>, CollisionObject<S>*, detail::SpatialHash<S>>>
enum fcl::SpatialHashingCollisionManager::ObjectStatus
private
Enumerator
Inside 
PartiallyPenetrating 
Outside 

Definition at line 147 of file broadphase_spatialhash.h.

Constructor & Destructor Documentation

◆ SpatialHashingCollisionManager()

template<typename S , typename HashTable >
fcl::SpatialHashingCollisionManager< S, HashTable >::SpatialHashingCollisionManager ( cell_size,
const Vector3< S > &  scene_min,
const Vector3< S > &  scene_max,
unsigned int  default_table_size = 1000 
)

Definition at line 55 of file broadphase_spatialhash-inl.h.

◆ ~SpatialHashingCollisionManager()

template<typename S , typename HashTable >
fcl::SpatialHashingCollisionManager< S, HashTable >::~SpatialHashingCollisionManager

Definition at line 68 of file broadphase_spatialhash-inl.h.

Member Function Documentation

◆ clear()

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::clear
virtual

clear the manager

Implements fcl::BroadPhaseCollisionManager< S >.

Definition at line 283 of file broadphase_spatialhash-inl.h.

◆ collide() [1/3]

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::collide ( BroadPhaseCollisionManager< S > *  other_manager,
void *  cdata,
CollisionCallBack< S >  callback 
) const
virtual

perform collision test with objects belonging to another manager

Implements fcl::BroadPhaseCollisionManager< S >.

Definition at line 543 of file broadphase_spatialhash-inl.h.

◆ collide() [2/3]

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::collide ( CollisionObject< S > *  obj,
void *  cdata,
CollisionCallBack< S >  callback 
) const
virtual

perform collision test between one object and all the objects belonging to the manager

Implements fcl::BroadPhaseCollisionManager< S >.

Definition at line 301 of file broadphase_spatialhash-inl.h.

◆ collide() [3/3]

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::collide ( void *  cdata,
CollisionCallBack< S >  callback 
) const
virtual

perform collision test for the objects belonging to the manager (i.e, N^2 self collision)

Implements fcl::BroadPhaseCollisionManager< S >.

Definition at line 460 of file broadphase_spatialhash-inl.h.

◆ collide_()

template<typename S , typename HashTable >
bool fcl::SpatialHashingCollisionManager< S, HashTable >::collide_ ( CollisionObject< S > *  obj,
void *  cdata,
CollisionCallBack< S >  callback 
) const
protected

perform collision test between one object and all the objects belonging to the manager

Definition at line 318 of file broadphase_spatialhash-inl.h.

◆ computeBound()

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::computeBound ( std::vector< CollisionObject< S > * > &  objs,
Vector3< S > &  l,
Vector3< S > &  u 
)
static

compute the bound for the environent

Definition at line 619 of file broadphase_spatialhash-inl.h.

◆ distance() [1/3]

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::distance ( BroadPhaseCollisionManager< S > *  other_manager,
void *  cdata,
DistanceCallBack< S >  callback 
) const
virtual

perform distance test with objects belonging to another manager

Implements fcl::BroadPhaseCollisionManager< S >.

Definition at line 576 of file broadphase_spatialhash-inl.h.

◆ distance() [2/3]

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::distance ( CollisionObject< S > *  obj,
void *  cdata,
DistanceCallBack< S >  callback 
) const
virtual

perform distance computation between one object and all the objects belonging ot the manager

Implements fcl::BroadPhaseCollisionManager< S >.

Definition at line 309 of file broadphase_spatialhash-inl.h.

◆ distance() [3/3]

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::distance ( void *  cdata,
DistanceCallBack< S >  callback 
) const
virtual

perform distance test for the objects belonging to the manager (i.e., N^2 self distance)

Implements fcl::BroadPhaseCollisionManager< S >.

Definition at line 520 of file broadphase_spatialhash-inl.h.

◆ distance_()

template<typename S , typename HashTable >
bool fcl::SpatialHashingCollisionManager< S, HashTable >::distance_ ( CollisionObject< S > *  obj,
void *  cdata,
DistanceCallBack< S >  callback,
S &  min_dist 
) const
protected

perform distance computation between one object and all the objects belonging ot the manager

Definition at line 374 of file broadphase_spatialhash-inl.h.

◆ distanceObjectToObjects()

template<typename S , typename HashTable >
template<typename Container >
bool fcl::SpatialHashingCollisionManager< S, HashTable >::distanceObjectToObjects ( CollisionObject< S > *  obj,
const Container &  objs,
void *  cdata,
DistanceCallBack< S >  callback,
S &  min_dist 
) const
private

Definition at line 633 of file broadphase_spatialhash-inl.h.

◆ empty()

template<typename S , typename HashTable >
bool fcl::SpatialHashingCollisionManager< S, HashTable >::empty
virtual

whether the manager is empty

Implements fcl::BroadPhaseCollisionManager< S >.

Definition at line 605 of file broadphase_spatialhash-inl.h.

◆ getObjects()

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::getObjects ( std::vector< CollisionObject< S > * > &  objs) const
virtual

return the objects managed by the manager

Implements fcl::BroadPhaseCollisionManager< S >.

Definition at line 293 of file broadphase_spatialhash-inl.h.

◆ registerObject()

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::registerObject ( CollisionObject< S > *  obj)
virtual

add one object to the manager

Implements fcl::BroadPhaseCollisionManager< S >.

Definition at line 75 of file broadphase_spatialhash-inl.h.

◆ setup()

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::setup
virtual

initialize the manager, related with the specific type of manager

Implements fcl::BroadPhaseCollisionManager< S >.

Definition at line 124 of file broadphase_spatialhash-inl.h.

◆ size()

template<typename S , typename HashTable >
size_t fcl::SpatialHashingCollisionManager< S, HashTable >::size
virtual

the number of objects managed by the manager

Implements fcl::BroadPhaseCollisionManager< S >.

Definition at line 612 of file broadphase_spatialhash-inl.h.

◆ unregisterObject()

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::unregisterObject ( CollisionObject< S > *  obj)
virtual

remove one object from the manager

Implements fcl::BroadPhaseCollisionManager< S >.

Definition at line 100 of file broadphase_spatialhash-inl.h.

◆ update() [1/3]

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::update
virtual

update the condition of manager

Implements fcl::BroadPhaseCollisionManager< S >.

Definition at line 131 of file broadphase_spatialhash-inl.h.

◆ update() [2/3]

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::update ( CollisionObject< S > *  updated_obj)
virtual

update the manager by explicitly given the object updated

Reimplemented from fcl::BroadPhaseCollisionManager< S >.

Definition at line 161 of file broadphase_spatialhash-inl.h.

◆ update() [3/3]

template<typename S , typename HashTable >
void fcl::SpatialHashingCollisionManager< S, HashTable >::update ( const std::vector< CollisionObject< S > * > &  updated_objs)
virtual

update the manager by explicitly given the set of objects update

Reimplemented from fcl::BroadPhaseCollisionManager< S >.

Definition at line 275 of file broadphase_spatialhash-inl.h.

Member Data Documentation

◆ hash_table

template<typename S , typename HashTable = detail::SimpleHashTable<AABB<S>, CollisionObject<S>*, detail::SpatialHash<S>>>
HashTable* fcl::SpatialHashingCollisionManager< S, HashTable >::hash_table
protected

objects in the scene limit (given by scene_min and scene_max) are in the spatial hash table

Definition at line 143 of file broadphase_spatialhash.h.

◆ obj_aabb_map

template<typename S , typename HashTable = detail::SimpleHashTable<AABB<S>, CollisionObject<S>*, detail::SpatialHash<S>>>
std::map<CollisionObject<S>*, AABB<S> > fcl::SpatialHashingCollisionManager< S, HashTable >::obj_aabb_map
protected

store the map between objects and their aabbs. will make update more convenient

Definition at line 140 of file broadphase_spatialhash.h.

◆ objs

template<typename S , typename HashTable = detail::SimpleHashTable<AABB<S>, CollisionObject<S>*, detail::SpatialHash<S>>>
std::list<CollisionObject<S>*> fcl::SpatialHashingCollisionManager< S, HashTable >::objs
protected

all objects in the scene

Definition at line 127 of file broadphase_spatialhash.h.

◆ objs_outside_scene_limit

template<typename S , typename HashTable = detail::SimpleHashTable<AABB<S>, CollisionObject<S>*, detail::SpatialHash<S>>>
std::list<CollisionObject<S>*> fcl::SpatialHashingCollisionManager< S, HashTable >::objs_outside_scene_limit
protected

objects outside the scene limit are in another list

Definition at line 134 of file broadphase_spatialhash.h.

◆ objs_partially_penetrating_scene_limit

template<typename S , typename HashTable = detail::SimpleHashTable<AABB<S>, CollisionObject<S>*, detail::SpatialHash<S>>>
std::list<CollisionObject<S>*> fcl::SpatialHashingCollisionManager< S, HashTable >::objs_partially_penetrating_scene_limit
protected

objects partially penetrating (not totally inside nor outside) the scene limit are in another list

Definition at line 131 of file broadphase_spatialhash.h.

◆ scene_limit

template<typename S , typename HashTable = detail::SimpleHashTable<AABB<S>, CollisionObject<S>*, detail::SpatialHash<S>>>
AABB<S> fcl::SpatialHashingCollisionManager< S, HashTable >::scene_limit
protected

the size of the scene

Definition at line 137 of file broadphase_spatialhash.h.


The documentation for this class was generated from the following files:


fcl
Author(s):
autogenerated on Tue Dec 5 2023 03:40:50