Go to the documentation of this file.
52 const std::vector<CollisionObject*>& other_objs) {
53 std::copy(other_objs.begin(), other_objs.end(), std::back_inserter(
objs));
81 std::vector<CollisionObject*>& objs_)
const {
82 objs_.resize(
objs.size());
83 std::copy(
objs.begin(),
objs.end(), objs_.begin());
90 if (
size() == 0)
return;
92 for (
auto* obj2 :
objs) {
101 if (
size() == 0)
return;
103 CoalScalar min_dist = (std::numeric_limits<CoalScalar>::max)();
104 for (
auto* obj2 :
objs) {
106 if ((*
callback)(obj, obj2, min_dist))
return;
114 if (
size() == 0)
return;
116 for (
typename std::list<CollisionObject*>::const_iterator it1 =
objs.begin(),
119 typename std::list<CollisionObject*>::const_iterator it2 = it1;
121 for (; it2 != end; ++it2) {
122 if ((*it1)->getAABB().overlap((*it2)->getAABB())) {
123 if ((*
callback)(*it1, *it2))
return;
132 if (
size() == 0)
return;
134 CoalScalar min_dist = (std::numeric_limits<CoalScalar>::max)();
135 for (
typename std::list<CollisionObject*>::const_iterator it1 =
objs.begin(),
138 typename std::list<CollisionObject*>::const_iterator it2 = it1;
140 for (; it2 != end; ++it2) {
141 if ((*it1)->getAABB().distance((*it2)->getAABB()) < min_dist) {
142 if ((*
callback)(*it1, *it2, min_dist))
return;
155 if ((
size() == 0) || (other_manager->
size() == 0))
return;
157 if (
this == other_manager) {
162 for (
auto* obj1 :
objs) {
163 for (
auto* obj2 : other_manager->
objs) {
164 if (obj1->getAABB().overlap(obj2->getAABB())) {
165 if ((*
callback)(obj1, obj2))
return;
178 if ((
size() == 0) || (other_manager->
size() == 0))
return;
180 if (
this == other_manager) {
185 CoalScalar min_dist = (std::numeric_limits<CoalScalar>::max)();
186 for (
auto* obj1 :
objs) {
187 for (
auto* obj2 : other_manager->
objs) {
188 if (obj1->getAABB().distance(obj2->getAABB()) < min_dist) {
189 if ((*
callback)(obj1, obj2, min_dist))
return;
std::list< CollisionObject * > objs
objects belonging to the manager are stored in a list structure
void registerObject(CollisionObject *obj)
add one object to the manager
virtual void update()
update the condition of manager
void setup()
initialize the manager, related with the specific type of manager
CoalScalar distance(const AABB &other) const
Distance between two AABBs.
Base class for broad phase collision. It helps to accelerate the collision/distance between N objects...
void unregisterObject(CollisionObject *obj)
remove one object from the manager
bool empty() const
whether the manager is empty
virtual std::vector< CollisionObject * > getObjects() const
return the objects managed by the manager
void collide(CollisionObject *obj, CollisionCallBackBase *callback) const
perform collision test between one object and all the objects belonging to the manager
void distance(CollisionObject *obj, DistanceCallBackBase *callback) const
perform distance computation between one object and all the objects belonging to the manager
Brute force N-body collision manager.
void clear()
clear the manager
Base callback class for distance queries. This class can be supersed by child classes to provide desi...
the object for collision or distance computation, contains the geometry and the transform information
const AABB & getAABB() const
get the AABB in world space
size_t size() const
the number of objects managed by the manager
Base callback class for collision queries. This class can be supersed by child classes to provide des...
void registerObjects(const std::vector< CollisionObject * > &other_objs)
add objects to the manager
hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:57