55template <
typename Derived>
56bool collisionRecurse_(
59 const AABB& root2_bv,
const Eigen::MatrixBase<Derived>& translation2,
68 const AABB& root_bv_t = translate(root2_bv, translation2);
79 return (*callback)(obj1, &obj2);
83 if (collisionRecurse_(nodes1, root1->
children[0], tree2,
nullptr,
84 root2_bv, translation2, callback))
86 if (collisionRecurse_(nodes1, root1->
children[1], tree2,
nullptr,
87 root2_bv, translation2, callback))
95 const AABB& root_bv_t = translate(root2_bv, translation2);
107 return (*callback)(obj1, &obj2);
114 const AABB& root_bv_t = translate(root2_bv, translation2);
119 if (collisionRecurse_(nodes1, root1->
children[0], tree2, root2, root2_bv,
120 translation2, callback))
122 if (collisionRecurse_(nodes1, root1->
children[1], tree2, root2, root2_bv,
123 translation2, callback))
126 for (
unsigned int i = 0; i < 8; ++i) {
130 computeChildBV(root2_bv, i, child_bv);
132 if (collisionRecurse_(nodes1, root1_id, tree2, child, child_bv,
133 translation2, callback))
137 computeChildBV(root2_bv, i, child_bv);
138 if (collisionRecurse_(nodes1, root1_id, tree2,
nullptr, child_bv,
139 translation2, callback))
149template <
typename Derived>
150bool distanceRecurse_(
153 const AABB& root2_bv,
const Eigen::MatrixBase<Derived>& translation2,
175 const AABB& aabb2 = translate(root2_bv, translation2);
182 if (distanceRecurse_(nodes1, root1->
children[1], tree2, root2, root2_bv,
183 translation2, callback, min_dist))
188 if (distanceRecurse_(nodes1, root1->
children[0], tree2, root2, root2_bv,
189 translation2, callback, min_dist))
194 if (distanceRecurse_(nodes1, root1->
children[0], tree2, root2, root2_bv,
195 translation2, callback, min_dist))
200 if (distanceRecurse_(nodes1, root1->
children[1], tree2, root2, root2_bv,
201 translation2, callback, min_dist))
206 for (
unsigned int i = 0; i < 8; ++i) {
210 computeChildBV(root2_bv, i, child_bv);
212 const AABB& aabb2 = translate(child_bv, translation2);
216 if (distanceRecurse_(nodes1, root1_id, tree2, child, child_bv,
217 translation2, callback, min_dist))