38 #ifndef FCL_TRAVERSAL_SHAPEMESHDISTANCETRAVERSALNODE_INL_H
39 #define FCL_TRAVERSAL_SHAPEMESHDISTANCETRAVERSALNODE_INL_H
52 template <
typename Shape,
typename BV,
typename NarrowPhaseSolver>
58 tri_indices =
nullptr;
67 template <
typename Shape,
typename BV,
typename NarrowPhaseSolver>
72 using S =
typename BV::S;
74 if(this->enable_statistics) this->num_leaf_tests++;
76 const BVNode<BV>& node = this->model2->getBV(b2);
80 const Triangle& tri_id = tri_indices[primitive_id];
88 nsolver->shapeTriangleDistance(*(this->model1), this->tf1, p1, p2, p3, &
distance, &closest_p1, &closest_p2);
101 template <
typename Shape,
typename BV,
typename NarrowPhaseSolver>
104 if((c >= this->result->min_distance - abs_err) && (c * (1 + rel_err) >= this->result->min_distance))
110 template <
typename Shape,
typename BV,
typename NarrowPhaseSolver>
118 const NarrowPhaseSolver* nsolver,
124 using S =
typename BV::S;
129 if(!tf2.matrix().isIdentity())
131 std::vector<Vector3<S>> vertices_transformed(model2.
num_vertices);
136 vertices_transformed[i] = new_v;
164 template <
typename Shape,
typename NarrowPhaseSolver>
171 template <
typename Shape,
typename NarrowPhaseSolver>
175 this->model2, this->vertices, this->tri_indices, 0,
176 *(this->model1), this->tf2, this->tf1, this->nsolver, this->request, *(this->result));
180 template <
typename Shape,
typename NarrowPhaseSolver>
186 template <
typename Shape,
typename NarrowPhaseSolver>
193 if(this->enable_statistics) this->num_bv_tests++;
194 return distance(this->tf2.linear(), this->tf2.translation(), this->model1_bv, this->model2->getBV(b2).bv);
198 template <
typename Shape,
typename NarrowPhaseSolver>
203 this->tf2, this->tf1, this->nsolver, this->enable_statistics, this->num_leaf_tests, this->request, *(this->result));
207 template <
typename Shape,
typename NarrowPhaseSolver>
215 template <
typename Shape,
typename NarrowPhaseSolver>
231 template <
typename Shape,
typename NarrowPhaseSolver>
237 template <
typename Shape,
typename NarrowPhaseSolver>
244 if(this->enable_statistics) this->num_bv_tests++;
245 return distance(this->tf2.linear(), this->tf2.translation(), this->model1_bv, this->model2->getBV(b2).bv);
249 template <
typename Shape,
typename NarrowPhaseSolver>
254 this->tf2, this->tf1, this->nsolver, this->enable_statistics, this->num_leaf_tests, this->request, *(this->result));
258 template <
typename Shape,
typename NarrowPhaseSolver>
265 template <
typename Shape,
typename NarrowPhaseSolver>
281 template <
typename Shape,
typename NarrowPhaseSolver>
288 template <
typename Shape,
typename NarrowPhaseSolver>
295 if(this->enable_statistics) this->num_bv_tests++;
296 return distance(this->tf2.linear(), this->tf2.translation(), this->model1_bv, this->model2->getBV(b2).bv);
300 template <
typename Shape,
typename NarrowPhaseSolver>
314 this->enable_statistics,
315 this->num_leaf_tests,
320 template <
typename Shape,
typename BV,
typename NarrowPhaseSolver,
template <
typename,
typename>
class OrientedNode>
324 const NarrowPhaseSolver* nsolver,
331 node.request = request;
332 node.result = &result;
334 node.model1 = &model1;
336 node.model2 = &model2;
338 node.nsolver = nsolver;
344 node.R = tf2.linear();
345 node.T = tf2.translation();
351 template <
typename Shape,
typename NarrowPhaseSolver>
356 const NarrowPhaseSolver* nsolver,
364 template <
typename Shape,
typename NarrowPhaseSolver>
369 const NarrowPhaseSolver* nsolver,
377 template <
typename Shape,
typename NarrowPhaseSolver>
382 const NarrowPhaseSolver* nsolver,