38 #ifndef FCL_BROAD_PHASE_DYNAMIC_AABB_TREE_INL_H 39 #define FCL_BROAD_PHASE_DYNAMIC_AABB_TREE_INL_H 41 #include "fcl/broadphase/broadphase_dynamic_AABB_tree.h" 46 #include "fcl/geometry/octree/octree.h" 53 class DynamicAABBTreeCollisionManager<double>;
57 namespace dynamic_AABB_tree {
62 bool collisionRecurse_(
63 typename DynamicAABBTreeCollisionManager<S>::DynamicAABBNode* root1,
64 const OcTree<S>* tree2,
65 const typename OcTree<S>::OcTreeNode* root2,
66 const AABB<S>& root2_bv,
67 const Transform3<S>& tf2,
69 CollisionCallBack<S> callback)
75 CollisionObject<S>* obj1 =
static_cast<CollisionObject<S>*
>(root1->data);
80 convertBV(root1->bv, Transform3<S>::Identity(), obb1);
83 if(obb1.overlap(obb2))
85 Box<S>* box =
new Box<S>();
87 constructBox(root2_bv, tf2, *box, box_tf);
89 box->cost_density = tree2->getDefaultOccupancy();
91 CollisionObject<S> obj2(std::shared_ptr<CollisionGeometry<S>>(box), box_tf);
92 return callback(obj1, &obj2, cdata);
98 if(collisionRecurse_<S>(root1->children[0], tree2,
nullptr, root2_bv, tf2, cdata, callback))
100 if(collisionRecurse_<S>(root1->children[1], tree2,
nullptr, root2_bv, tf2, cdata, callback))
106 else if(root1->isLeaf() && !tree2->nodeHasChildren(root2))
108 CollisionObject<S>* obj1 =
static_cast<CollisionObject<S>*
>(root1->data);
110 if(!tree2->isNodeFree(root2) && !obj1->isFree())
113 convertBV(root1->bv, Transform3<S>::Identity(), obb1);
116 if(obb1.overlap(obb2))
118 Box<S>* box =
new Box<S>();
119 Transform3<S> box_tf;
120 constructBox(root2_bv, tf2, *box, box_tf);
122 box->cost_density = root2->getOccupancy();
123 box->threshold_occupied = tree2->getOccupancyThres();
125 CollisionObject<S> obj2(std::shared_ptr<CollisionGeometry<S>>(box), box_tf);
126 return callback(obj1, &obj2, cdata);
134 convertBV(root1->bv, Transform3<S>::Identity(), obb1);
137 if(tree2->isNodeFree(root2) || !obb1.overlap(obb2))
return false;
139 if(!tree2->nodeHasChildren(root2) || (!root1->isLeaf() && (root1->bv.size() > root2_bv.size())))
141 if(collisionRecurse_(root1->children[0], tree2, root2, root2_bv, tf2, cdata, callback))
143 if(collisionRecurse_(root1->children[1], tree2, root2, root2_bv, tf2, cdata, callback))
148 for(
unsigned int i = 0; i < 8; ++i)
150 if(tree2->nodeChildExists(root2, i))
152 const typename OcTree<S>::OcTreeNode* child = tree2->getNodeChild(root2, i);
154 computeChildBV(root2_bv, i, child_bv);
156 if(collisionRecurse_(root1, tree2, child, child_bv, tf2, cdata, callback))
162 computeChildBV(root2_bv, i, child_bv);
163 if(collisionRecurse_<S>(root1, tree2,
nullptr, child_bv, tf2, cdata, callback))
172 template <
typename S,
typename Derived>
173 bool collisionRecurse_(
174 typename DynamicAABBTreeCollisionManager<S>::DynamicAABBNode* root1,
175 const OcTree<S>* tree2,
176 const typename OcTree<S>::OcTreeNode* root2,
177 const AABB<S>& root2_bv,
178 const Eigen::MatrixBase<Derived>& translation2,
180 CollisionCallBack<S> callback)
186 CollisionObject<S>* obj1 =
static_cast<CollisionObject<S>*
>(root1->data);
190 const AABB<S>& root2_bv_t =
translate(root2_bv, translation2);
191 if(root1->bv.overlap(root2_bv_t))
193 Box<S>* box =
new Box<S>();
194 Transform3<S> box_tf;
195 Transform3<S> tf2 = Transform3<S>::Identity();
196 tf2.translation() = translation2;
197 constructBox(root2_bv, tf2, *box, box_tf);
199 box->cost_density = tree2->getOccupancyThres();
201 CollisionObject<S> obj2(std::shared_ptr<CollisionGeometry<S>>(box), box_tf);
202 return callback(obj1, &obj2, cdata);
208 if(collisionRecurse_<S>(root1->children[0], tree2,
nullptr, root2_bv, translation2, cdata, callback))
210 if(collisionRecurse_<S>(root1->children[1], tree2,
nullptr, root2_bv, translation2, cdata, callback))
216 else if(root1->isLeaf() && !tree2->nodeHasChildren(root2))
218 CollisionObject<S>* obj1 =
static_cast<CollisionObject<S>*
>(root1->data);
220 if(!tree2->isNodeFree(root2) && !obj1->isFree())
222 const AABB<S>& root2_bv_t =
translate(root2_bv, translation2);
223 if(root1->bv.overlap(root2_bv_t))
225 Box<S>* box =
new Box<S>();
226 Transform3<S> box_tf;
227 Transform3<S> tf2 = Transform3<S>::Identity();
228 tf2.translation() = translation2;
229 constructBox(root2_bv, tf2, *box, box_tf);
231 box->cost_density = root2->getOccupancy();
232 box->threshold_occupied = tree2->getOccupancyThres();
234 CollisionObject<S> obj2(std::shared_ptr<CollisionGeometry<S>>(box), box_tf);
235 return callback(obj1, &obj2, cdata);
242 const AABB<S>& root2_bv_t =
translate(root2_bv, translation2);
243 if(tree2->isNodeFree(root2) || !root1->bv.overlap(root2_bv_t))
return false;
245 if(!tree2->nodeHasChildren(root2) || (!root1->isLeaf() && (root1->bv.size() > root2_bv.size())))
247 if(collisionRecurse_(root1->children[0], tree2, root2, root2_bv, translation2, cdata, callback))
249 if(collisionRecurse_(root1->children[1], tree2, root2, root2_bv, translation2, cdata, callback))
254 for(
unsigned int i = 0; i < 8; ++i)
256 if(tree2->nodeChildExists(root2, i))
258 const typename OcTree<S>::OcTreeNode* child = tree2->getNodeChild(root2, i);
260 computeChildBV(root2_bv, i, child_bv);
262 if(collisionRecurse_(root1, tree2, child, child_bv, translation2, cdata, callback))
268 computeChildBV(root2_bv, i, child_bv);
269 if(collisionRecurse_<S>(root1, tree2,
nullptr, child_bv, translation2, cdata, callback))
278 template <
typename S>
279 bool distanceRecurse_(
280 typename DynamicAABBTreeCollisionManager<S>::DynamicAABBNode* root1,
281 const OcTree<S>* tree2,
282 const typename OcTree<S>::OcTreeNode* root2,
283 const AABB<S>& root2_bv,
284 const Transform3<S>& tf2,
286 DistanceCallBack<S> callback,
289 if(root1->isLeaf() && !tree2->nodeHasChildren(root2))
291 if(tree2->isNodeOccupied(root2))
293 Box<S>* box =
new Box<S>();
294 Transform3<S> box_tf;
295 constructBox(root2_bv, tf2, *box, box_tf);
296 CollisionObject<S> obj(std::shared_ptr<CollisionGeometry<S>>(box), box_tf);
297 return callback(
static_cast<CollisionObject<S>*
>(root1->data), &obj, cdata, min_dist);
302 if(!tree2->isNodeOccupied(root2))
return false;
304 if(!tree2->nodeHasChildren(root2) || (!root1->isLeaf() && (root1->bv.size() > root2_bv.size())))
309 S d1 = aabb2.distance(root1->children[0]->bv);
310 S d2 = aabb2.distance(root1->children[1]->bv);
316 if(distanceRecurse_(root1->children[1], tree2, root2, root2_bv, tf2, cdata, callback, min_dist))
322 if(distanceRecurse_(root1->children[0], tree2, root2, root2_bv, tf2, cdata, callback, min_dist))
330 if(distanceRecurse_(root1->children[0], tree2, root2, root2_bv, tf2, cdata, callback, min_dist))
336 if(distanceRecurse_(root1->children[1], tree2, root2, root2_bv, tf2, cdata, callback, min_dist))
343 for(
unsigned int i = 0; i < 8; ++i)
345 if(tree2->nodeChildExists(root2, i))
347 const typename OcTree<S>::OcTreeNode* child = tree2->getNodeChild(root2, i);
349 computeChildBV(root2_bv, i, child_bv);
353 S d = root1->bv.distance(aabb2);
357 if(distanceRecurse_(root1, tree2, child, child_bv, tf2, cdata, callback, min_dist))
368 template <
typename S>
369 bool collisionRecurse(
370 typename DynamicAABBTreeCollisionManager<S>::DynamicAABBNode* root1,
371 const OcTree<S>* tree2,
372 const typename OcTree<S>::OcTreeNode* root2,
373 const AABB<S>& root2_bv,
374 const Transform3<S>& tf2,
376 CollisionCallBack<S> callback)
378 if(tf2.linear().isIdentity())
379 return collisionRecurse_(root1, tree2, root2, root2_bv, tf2.translation(), cdata, callback);
381 return collisionRecurse_(root1, tree2, root2, root2_bv, tf2, cdata, callback);
385 template <
typename S,
typename Derived>
386 bool distanceRecurse_(
387 typename DynamicAABBTreeCollisionManager<S>::DynamicAABBNode* root1,
388 const OcTree<S>* tree2,
389 const typename OcTree<S>::OcTreeNode* root2,
390 const AABB<S>& root2_bv,
391 const Eigen::MatrixBase<Derived>& translation2,
393 DistanceCallBack<S> callback,
396 if(root1->isLeaf() && !tree2->nodeHasChildren(root2))
398 if(tree2->isNodeOccupied(root2))
400 Box<S>* box =
new Box<S>();
401 Transform3<S> box_tf;
402 Transform3<S> tf2 = Transform3<S>::Identity();
403 tf2.translation() = translation2;
404 constructBox(root2_bv, tf2, *box, box_tf);
405 CollisionObject<S> obj(std::shared_ptr<CollisionGeometry<S>>(box), box_tf);
406 return callback(
static_cast<CollisionObject<S>*
>(root1->data), &obj, cdata, min_dist);
411 if(!tree2->isNodeOccupied(root2))
return false;
413 if(!tree2->nodeHasChildren(root2) || (!root1->isLeaf() && (root1->bv.size() > root2_bv.size())))
415 const AABB<S>& aabb2 =
translate(root2_bv, translation2);
416 S d1 = aabb2.distance(root1->children[0]->bv);
417 S d2 = aabb2.distance(root1->children[1]->bv);
423 if(distanceRecurse_(root1->children[1], tree2, root2, root2_bv, translation2, cdata, callback, min_dist))
429 if(distanceRecurse_(root1->children[0], tree2, root2, root2_bv, translation2, cdata, callback, min_dist))
437 if(distanceRecurse_(root1->children[0], tree2, root2, root2_bv, translation2, cdata, callback, min_dist))
443 if(distanceRecurse_(root1->children[1], tree2, root2, root2_bv, translation2, cdata, callback, min_dist))
450 for(
unsigned int i = 0; i < 8; ++i)
452 if(tree2->nodeChildExists(root2, i))
454 const typename OcTree<S>::OcTreeNode* child = tree2->getNodeChild(root2, i);
456 computeChildBV(root2_bv, i, child_bv);
457 const AABB<S>& aabb2 =
translate(child_bv, translation2);
459 S d = root1->bv.distance(aabb2);
463 if(distanceRecurse_(root1, tree2, child, child_bv, translation2, cdata, callback, min_dist))
474 template <
typename S>
475 bool distanceRecurse(
typename DynamicAABBTreeCollisionManager<S>::DynamicAABBNode* root1,
const OcTree<S>* tree2,
const typename OcTree<S>::OcTreeNode* root2,
const AABB<S>& root2_bv,
const Transform3<S>& tf2,
void* cdata, DistanceCallBack<S> callback, S& min_dist)
477 if(tf2.linear().isIdentity())
478 return distanceRecurse_(root1, tree2, root2, root2_bv, tf2.translation(), cdata, callback, min_dist);
480 return distanceRecurse_(root1, tree2, root2, root2_bv, tf2, cdata, callback, min_dist);
486 template <
typename S>
487 bool collisionRecurse(
488 typename DynamicAABBTreeCollisionManager<S>::DynamicAABBNode* root1,
489 typename DynamicAABBTreeCollisionManager<S>::DynamicAABBNode* root2,
491 CollisionCallBack<S> callback)
493 if(root1->isLeaf() && root2->isLeaf())
495 if(!root1->bv.overlap(root2->bv))
return false;
496 return callback(
static_cast<CollisionObject<S>*
>(root1->data), static_cast<CollisionObject<S>*>(root2->data), cdata);
499 if(!root1->bv.overlap(root2->bv))
return false;
501 if(root2->isLeaf() || (!root1->isLeaf() && (root1->bv.size() > root2->bv.size())))
503 if(collisionRecurse(root1->children[0], root2, cdata, callback))
505 if(collisionRecurse(root1->children[1], root2, cdata, callback))
510 if(collisionRecurse(root1, root2->children[0], cdata, callback))
512 if(collisionRecurse(root1, root2->children[1], cdata, callback))
519 template <
typename S>
520 bool collisionRecurse(
typename DynamicAABBTreeCollisionManager<S>::DynamicAABBNode* root, CollisionObject<S>* query,
void* cdata, CollisionCallBack<S> callback)
524 if(!root->bv.overlap(query->getAABB()))
return false;
525 return callback(
static_cast<CollisionObject<S>*
>(root->data), query, cdata);
528 if(!root->bv.overlap(query->getAABB()))
return false;
530 int select_res = select(query->getAABB(), *(root->children[0]), *(root->children[1]));
532 if(collisionRecurse(root->children[select_res], query, cdata, callback))
535 if(collisionRecurse(root->children[1-select_res], query, cdata, callback))
542 template <
typename S>
543 bool selfCollisionRecurse(
typename DynamicAABBTreeCollisionManager<S>::DynamicAABBNode* root,
void* cdata, CollisionCallBack<S> callback)
545 if(root->isLeaf())
return false;
547 if(selfCollisionRecurse(root->children[0], cdata, callback))
550 if(selfCollisionRecurse(root->children[1], cdata, callback))
553 if(collisionRecurse(root->children[0], root->children[1], cdata, callback))
560 template <
typename S>
561 bool distanceRecurse(
562 typename DynamicAABBTreeCollisionManager<S>::DynamicAABBNode* root1,
563 typename DynamicAABBTreeCollisionManager<S>::DynamicAABBNode* root2,
565 DistanceCallBack<S> callback,
568 if(root1->isLeaf() && root2->isLeaf())
570 CollisionObject<S>* root1_obj =
static_cast<CollisionObject<S>*
>(root1->data);
571 CollisionObject<S>* root2_obj =
static_cast<CollisionObject<S>*
>(root2->data);
572 return callback(root1_obj, root2_obj, cdata, min_dist);
575 if(root2->isLeaf() || (!root1->isLeaf() && (root1->bv.size() > root2->bv.size())))
577 S d1 = root2->bv.distance(root1->children[0]->bv);
578 S d2 = root2->bv.distance(root1->children[1]->bv);
584 if(distanceRecurse(root1->children[1], root2, cdata, callback, min_dist))
590 if(distanceRecurse(root1->children[0], root2, cdata, callback, min_dist))
598 if(distanceRecurse(root1->children[0], root2, cdata, callback, min_dist))
604 if(distanceRecurse(root1->children[1], root2, cdata, callback, min_dist))
611 S d1 = root1->bv.distance(root2->children[0]->bv);
612 S d2 = root1->bv.distance(root2->children[1]->bv);
618 if(distanceRecurse(root1, root2->children[1], cdata, callback, min_dist))
624 if(distanceRecurse(root1, root2->children[0], cdata, callback, min_dist))
632 if(distanceRecurse(root1, root2->children[0], cdata, callback, min_dist))
638 if(distanceRecurse(root1, root2->children[1], cdata, callback, min_dist))
648 template <
typename S>
649 bool distanceRecurse(
typename DynamicAABBTreeCollisionManager<S>::DynamicAABBNode* root, CollisionObject<S>* query,
void* cdata, DistanceCallBack<S> callback, S& min_dist)
653 CollisionObject<S>* root_obj =
static_cast<CollisionObject<S>*
>(root->data);
654 return callback(root_obj, query, cdata, min_dist);
657 S d1 = query->getAABB().distance(root->children[0]->bv);
658 S d2 = query->getAABB().distance(root->children[1]->bv);
664 if(distanceRecurse(root->children[1], query, cdata, callback, min_dist))
670 if(distanceRecurse(root->children[0], query, cdata, callback, min_dist))
678 if(distanceRecurse(root->children[0], query, cdata, callback, min_dist))
684 if(distanceRecurse(root->children[1], query, cdata, callback, min_dist))
693 template <
typename S>
694 bool selfDistanceRecurse(
typename DynamicAABBTreeCollisionManager<S>::DynamicAABBNode* root,
void* cdata, DistanceCallBack<S> callback, S& min_dist)
696 if(root->isLeaf())
return false;
698 if(selfDistanceRecurse(root->children[0], cdata, callback, min_dist))
701 if(selfDistanceRecurse(root->children[1], cdata, callback, min_dist))
704 if(distanceRecurse(root->children[0], root->children[1], cdata, callback, min_dist))
715 template <
typename S>
716 DynamicAABBTreeCollisionManager<S>::DynamicAABBTreeCollisionManager()
717 : tree_topdown_balance_threshold(dtree.bu_threshold),
718 tree_topdown_level(dtree.topdown_level)
720 max_tree_nonbalanced_level = 10;
721 tree_incremental_balance_pass = 10;
722 tree_topdown_balance_threshold = 2;
723 tree_topdown_level = 0;
728 octree_as_geometry_collide =
true;
729 octree_as_geometry_distance =
false;
733 template <
typename S>
737 if(other_objs.empty())
return;
745 std::vector<DynamicAABBNode*> leaves(other_objs.size());
746 table.rehash(other_objs.size());
747 for(
size_t i = 0,
size = other_objs.size(); i <
size; ++i)
750 node->
bv = other_objs[i]->getAABB();
753 node->data = other_objs[i];
754 table[other_objs[i]] = node;
758 dtree.init(leaves, tree_init_level);
765 template <
typename S>
773 template <
typename S>
782 template <
typename S>
787 int num = dtree.size();
794 int height = dtree.getMaxHeight();
797 if(height - std::log((S)num) / std::log(2.0) < max_tree_nonbalanced_level)
798 dtree.balanceIncremental(tree_incremental_balance_pass);
800 dtree.balanceTopdown();
807 template <
typename S>
810 for(
auto it = table.cbegin(); it != table.cend(); ++it)
824 template <
typename S>
827 const auto it = table.find(updated_obj);
828 if(it != table.end())
831 if(!node->
bv.equal(updated_obj->
getAABB()))
832 dtree.update(node, updated_obj->
getAABB());
838 template <
typename S>
841 update_(updated_obj);
846 template <
typename S>
849 for(
size_t i = 0,
size = updated_objs.size(); i <
size; ++i)
850 update_(updated_objs[i]);
855 template <
typename S>
863 template <
typename S>
866 objs.resize(this->
size());
867 std::transform(table.begin(), table.end(), objs.begin(), std::bind(&DynamicAABBTable::value_type::first, std::placeholders::_1));
871 template <
typename S>
874 if(
size() == 0)
return;
880 if(!octree_as_geometry_collide)
882 const OcTree<S>* octree =
static_cast<const OcTree<S>*
>(obj->
collisionGeometry().get());
883 detail::dynamic_AABB_tree::collisionRecurse(dtree.getRoot(), octree, octree->getRoot(), octree->getRootBV(), obj->
getTransform(), cdata, callback);
886 detail::dynamic_AABB_tree::collisionRecurse(dtree.getRoot(), obj, cdata, callback);
891 detail::dynamic_AABB_tree::collisionRecurse(dtree.getRoot(), obj, cdata, callback);
896 template <
typename S>
899 if(
size() == 0)
return;
900 S min_dist = std::numeric_limits<S>::max();
906 if(!octree_as_geometry_distance)
908 const OcTree<S>* octree =
static_cast<const OcTree<S>*
>(obj->
collisionGeometry().get());
909 detail::dynamic_AABB_tree::distanceRecurse(dtree.getRoot(), octree, octree->getRoot(), octree->getRootBV(), obj->
getTransform(), cdata, callback, min_dist);
912 detail::dynamic_AABB_tree::distanceRecurse(dtree.getRoot(), obj, cdata, callback, min_dist);
917 detail::dynamic_AABB_tree::distanceRecurse(dtree.getRoot(), obj, cdata, callback, min_dist);
922 template <
typename S>
925 if(
size() == 0)
return;
926 detail::dynamic_AABB_tree::selfCollisionRecurse(dtree.getRoot(), cdata, callback);
930 template <
typename S>
933 if(
size() == 0)
return;
934 S min_dist = std::numeric_limits<S>::max();
935 detail::dynamic_AABB_tree::selfDistanceRecurse(dtree.getRoot(), cdata, callback, min_dist);
939 template <
typename S>
943 if((
size() == 0) || (other_manager->
size() == 0))
return;
944 detail::dynamic_AABB_tree::collisionRecurse(dtree.getRoot(), other_manager->dtree.getRoot(), cdata, callback);
948 template <
typename S>
952 if((
size() == 0) || (other_manager->
size() == 0))
return;
953 S min_dist = std::numeric_limits<S>::max();
954 detail::dynamic_AABB_tree::distanceRecurse(dtree.getRoot(), other_manager->dtree.getRoot(), cdata, callback, min_dist);
958 template <
typename S>
961 return dtree.empty();
965 template <
typename S>
972 template <
typename S>
virtual void setup()=0
initialize the manager, related with the specific type of manager
dynamic AABB<S> tree node
Definition: node_base.h:51
void convertBV(const BV1 &bv1, const Transform3< typename BV1::S > &tf1, BV2 &bv2)
Convert a bounding volume of type BV1 in configuration tf1 to bounding volume of type BV2 in identity...
Definition: utility-inl.h:934
Main namespace.
Definition: broadphase_bruteforce-inl.h:45
void unregisterObject(CollisionObject< S > *obj)
remove one object from the manager
Definition: broadphase_dynamic_AABB_tree-inl.h:774
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 ...
Definition: broadphase_dynamic_AABB_tree-inl.h:897
AABB< S > translate(const AABB< S > &aabb, const Eigen::MatrixBase< Derived > &t)
translate the center of AABB by t
Definition: AABB-inl.h:345
NodeBase< BV > * parent
pointer to parent node
Definition: node_base.h:57
size_t size() const
the number of objects managed by the manager
Definition: broadphase_dynamic_AABB_tree-inl.h:966
void update()
update the condition of manager
Definition: broadphase_dynamic_AABB_tree-inl.h:808
NodeBase< BV > * children[2]
for leaf node, children nodes
Definition: node_base.h:68
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 ...
Definition: broadphase_dynamic_AABB_tree-inl.h:872
virtual void registerObjects(const std::vector< CollisionObject< S > * > &other_objs)
add objects to the manager
Definition: broadphase_collision_manager-inl.h:66
void clear()
clear the manager
Definition: broadphase_dynamic_AABB_tree-inl.h:856
bool(*)(CollisionObject< S > *o1, CollisionObject< S > *o2, void *cdata) CollisionCallBack
Callback for collision between two objects. Return value is whether can stop now. ...
Definition: broadphase_collision_manager.h:53
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...
Definition: broadphase_collision_manager.h:60
void getObjects(std::vector< CollisionObject< S > * > &objs) const
return the objects managed by the manager
Definition: broadphase_dynamic_AABB_tree-inl.h:864
Class for hierarchy tree structure.
Definition: hierarchy_tree.h:58
const Transform3< S > & getTransform() const
get object's transform
Definition: collision_object-inl.h:170
void registerObject(CollisionObject< S > *obj)
add one object to the manager
Definition: broadphase_dynamic_AABB_tree-inl.h:766
virtual size_t size() const =0
the number of objects managed by the manager
const std::shared_ptr< const CollisionGeometry< S > > & collisionGeometry() const
get geometry from the object instance
Definition: collision_object-inl.h:243
const AABB< S > & getAABB() const
get the AABB in world space
Definition: collision_object-inl.h:111
the object for collision or distance computation, contains the geometry and the transform information...
Definition: collision_object.h:51
BV bv
the bounding volume for the node
Definition: node_base.h:54
bool empty() const
whether the manager is empty
Definition: broadphase_dynamic_AABB_tree-inl.h:959
Base class for broad phase collision. It helps to accelerate the collision/distance between N objects...
Definition: broadphase_collision_manager.h:66
Definition: broadphase_dynamic_AABB_tree.h:54
void registerObjects(const std::vector< CollisionObject< S > * > &other_objs)
add objects to the manager
Definition: broadphase_dynamic_AABB_tree-inl.h:734
void setup()
initialize the manager, related with the specific type of manager
Definition: broadphase_dynamic_AABB_tree-inl.h:783