38 #ifndef COAL_BROAD_PHASE_DYNAMIC_AABB_TREE_ARRAY_INL_H
39 #define COAL_BROAD_PHASE_DYNAMIC_AABB_TREE_ARRAY_INL_H
50 namespace dynamic_AABB_tree_array {
55 template <
typename Derived>
56 bool collisionRecurse_(
59 const AABB& root2_bv,
const Eigen::MatrixBase<Derived>& translation2,
69 if (root1->
bv.overlap(root_bv_t)) {
73 tf2.translation() = translation2;
83 if (collisionRecurse_(nodes1, root1->
children[0], tree2,
nullptr,
86 if (collisionRecurse_(nodes1, root1->
children[1], tree2,
nullptr,
96 if (root1->
bv.overlap(root_bv_t)) {
100 tf2.translation() = translation2;
103 box->cost_density = root2->getOccupancy();
115 if (tree2->
isNodeFree(root2) || !root1->
bv.overlap(root_bv_t))
return false;
118 (!root1->
isLeaf() && (root1->
bv.size() > root2_bv.
size()))) {
119 if (collisionRecurse_(nodes1, root1->
children[0], tree2, root2, root2_bv,
122 if (collisionRecurse_(nodes1, root1->
children[1], tree2, root2, root2_bv,
126 for (
unsigned int i = 0; i < 8; ++i) {
132 if (collisionRecurse_(nodes1, root1_id, tree2, child, child_bv,
138 if (collisionRecurse_(nodes1, root1_id, tree2,
nullptr, child_bv,
149 template <
typename Derived>
150 bool distanceRecurse_(
153 const AABB& root2_bv,
const Eigen::MatrixBase<Derived>& translation2,
162 tf2.translation() = translation2;
174 (!root1->
isLeaf() && (root1->
bv.size() > root2_bv.
size()))) {
182 if (distanceRecurse_(nodes1, root1->
children[1], tree2, root2, root2_bv,
188 if (distanceRecurse_(nodes1, root1->
children[0], tree2, root2, root2_bv,
194 if (distanceRecurse_(nodes1, root1->
children[0], tree2, root2, root2_bv,
200 if (distanceRecurse_(nodes1, root1->
children[1], tree2, root2, root2_bv,
206 for (
unsigned int i = 0; i < 8; ++i) {
216 if (distanceRecurse_(nodes1, root1_id, tree2, child, child_bv,