55namespace dynamic_AABB_tree {
60template <
typename Derived>
64 const Eigen::MatrixBase<Derived>& translation2,
72 if (root1->
bv.overlap(root2_bv_t)) {
83 return (*callback)(obj1, &obj2);
87 if (collisionRecurse_(root1->
children[0], tree2,
nullptr, root2_bv,
88 translation2, callback))
90 if (collisionRecurse_(root1->
children[1], tree2,
nullptr, root2_bv,
91 translation2, callback))
101 if (root1->
bv.overlap(root2_bv_t)) {
112 return (*callback)(obj1, &obj2);
120 if (tree2->
isNodeFree(root2) || !root1->
bv.overlap(root2_bv_t))
return false;
123 (!root1->
isLeaf() && (root1->
bv.size() > root2_bv.
size()))) {
124 if (collisionRecurse_(root1->
children[0], tree2, root2, root2_bv,
125 translation2, callback))
127 if (collisionRecurse_(root1->
children[1], tree2, root2, root2_bv,
128 translation2, callback))
131 for (
unsigned int i = 0; i < 8; ++i) {
135 computeChildBV(root2_bv, i, child_bv);
137 if (collisionRecurse_(root1, tree2, child, child_bv, translation2,
142 computeChildBV(root2_bv, i, child_bv);
143 if (collisionRecurse_(root1, tree2,
nullptr, child_bv, translation2,
153template <
typename Derived>
156 const AABB& root2_bv,
157 const Eigen::MatrixBase<Derived>& translation2,
176 (!root1->
isLeaf() && (root1->
bv.size() > root2_bv.
size()))) {
183 if (distanceRecurse_(root1->
children[1], tree2, root2, root2_bv,
184 translation2, callback, min_dist))
189 if (distanceRecurse_(root1->
children[0], tree2, root2, root2_bv,
190 translation2, callback, min_dist))
195 if (distanceRecurse_(root1->
children[0], tree2, root2, root2_bv,
196 translation2, callback, min_dist))
201 if (distanceRecurse_(root1->
children[1], tree2, root2, root2_bv,
202 translation2, callback, min_dist))
207 for (
unsigned int i = 0; i < 8; ++i) {
211 computeChildBV(root2_bv, i, child_bv);
214 Scalar d = root1->
bv.distance(aabb2);
217 if (distanceRecurse_(root1, tree2, child, child_bv, translation2,