38 #ifndef FCL_DISTANCE_FUNC_MATRIX_INL_H 39 #define FCL_DISTANCE_FUNC_MATRIX_INL_H 41 #include "fcl/narrowphase/detail/distance_func_matrix.h" 43 #include "fcl/config.h" 45 #include "fcl/common/types.h" 47 #include "fcl/narrowphase/collision_object.h" 49 #include "fcl/narrowphase/detail/traversal/collision_node.h" 50 #include "fcl/narrowphase/detail/gjk_solver_indep.h" 51 #include "fcl/narrowphase/detail/gjk_solver_libccd.h" 53 #include "fcl/narrowphase/detail/traversal/distance/bvh_distance_traversal_node.h" 54 #include "fcl/narrowphase/detail/traversal/distance/bvh_shape_distance_traversal_node.h" 55 #include "fcl/narrowphase/detail/traversal/distance/distance_traversal_node_base.h" 56 #include "fcl/narrowphase/detail/traversal/distance/mesh_distance_traversal_node.h" 57 #include "fcl/narrowphase/detail/traversal/distance/mesh_conservative_advancement_traversal_node.h" 58 #include "fcl/narrowphase/detail/traversal/distance/mesh_shape_distance_traversal_node.h" 59 #include "fcl/narrowphase/detail/traversal/distance/mesh_shape_conservative_advancement_traversal_node.h" 60 #include "fcl/narrowphase/detail/traversal/distance/shape_bvh_distance_traversal_node.h" 61 #include "fcl/narrowphase/detail/traversal/distance/shape_distance_traversal_node.h" 62 #include "fcl/narrowphase/detail/traversal/distance/shape_conservative_advancement_traversal_node.h" 63 #include "fcl/narrowphase/detail/traversal/distance/shape_mesh_distance_traversal_node.h" 64 #include "fcl/narrowphase/detail/traversal/distance/shape_mesh_conservative_advancement_traversal_node.h" 68 #include "fcl/narrowphase/detail/traversal/octree/distance/mesh_octree_distance_traversal_node.h" 69 #include "fcl/narrowphase/detail/traversal/octree/distance/octree_distance_traversal_node.h" 70 #include "fcl/narrowphase/detail/traversal/octree/distance/octree_mesh_distance_traversal_node.h" 71 #include "fcl/narrowphase/detail/traversal/octree/distance/octree_shape_distance_traversal_node.h" 72 #include "fcl/narrowphase/detail/traversal/octree/distance/shape_octree_distance_traversal_node.h" 74 #endif // FCL_HAVE_OCTOMAP 84 template <
typename Shape,
typename NarrowPhaseSolver>
85 typename Shape::S ShapeOcTreeDistance(
86 const CollisionGeometry<typename Shape::S>* o1,
87 const Transform3<typename Shape::S>& tf1,
88 const CollisionGeometry<typename Shape::S>* o2,
89 const Transform3<typename Shape::S>& tf2,
90 const NarrowPhaseSolver* nsolver,
91 const DistanceRequest<typename Shape::S>& request,
92 DistanceResult<typename Shape::S>& result)
94 using S =
typename Shape::S;
96 if(request.isSatisfied(result))
return result.min_distance;
97 ShapeOcTreeDistanceTraversalNode<Shape, NarrowPhaseSolver> node;
98 const Shape* obj1 = static_cast<const Shape*>(o1);
99 const OcTree<S>* obj2 =
static_cast<const OcTree<S>*
>(o2);
100 OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver);
102 initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, request, result);
105 return result.min_distance;
108 template <
typename Shape,
typename NarrowPhaseSolver>
109 typename Shape::S OcTreeShapeDistance(
110 const CollisionGeometry<typename Shape::S>* o1,
111 const Transform3<typename Shape::S>& tf1,
112 const CollisionGeometry<typename Shape::S>* o2,
113 const Transform3<typename Shape::S>& tf2,
114 const NarrowPhaseSolver* nsolver,
115 const DistanceRequest<typename Shape::S>& request,
116 DistanceResult<typename Shape::S>& result)
118 using S =
typename Shape::S;
120 if(request.isSatisfied(result))
return result.min_distance;
121 OcTreeShapeDistanceTraversalNode<Shape, NarrowPhaseSolver> node;
122 const OcTree<S>* obj1 = static_cast<
const OcTree<S>*>(o1);
123 const Shape* obj2 =
static_cast<const Shape*
>(o2);
124 OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver);
126 initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, request, result);
129 return result.min_distance;
132 template <
typename NarrowPhaseSolver>
133 typename NarrowPhaseSolver::S OcTreeDistance(
134 const CollisionGeometry<typename NarrowPhaseSolver::S>* o1,
135 const Transform3<typename NarrowPhaseSolver::S>& tf1,
136 const CollisionGeometry<typename NarrowPhaseSolver::S>* o2,
137 const Transform3<typename NarrowPhaseSolver::S>& tf2,
138 const NarrowPhaseSolver* nsolver,
139 const DistanceRequest<typename NarrowPhaseSolver::S>& request,
140 DistanceResult<typename NarrowPhaseSolver::S>& result)
142 using S =
typename NarrowPhaseSolver::S;
144 if(request.isSatisfied(result))
return result.min_distance;
145 OcTreeDistanceTraversalNode<NarrowPhaseSolver> node;
146 const OcTree<S>* obj1 = static_cast<
const OcTree<S>*>(o1);
147 const OcTree<S>* obj2 =
static_cast<const OcTree<S>*
>(o2);
148 OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver);
150 initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, request, result);
153 return result.min_distance;
156 template <
typename BV,
typename NarrowPhaseSolver>
157 typename BV::S BVHOcTreeDistance(
158 const CollisionGeometry<typename BV::S>* o1,
159 const Transform3<typename BV::S>& tf1,
160 const CollisionGeometry<typename BV::S>* o2,
161 const Transform3<typename BV::S>& tf2,
162 const NarrowPhaseSolver* nsolver,
163 const DistanceRequest<typename BV::S>& request,
164 DistanceResult<typename BV::S>& result)
166 using S =
typename BV::S;
168 if(request.isSatisfied(result))
return result.min_distance;
169 MeshOcTreeDistanceTraversalNode<BV, NarrowPhaseSolver> node;
170 const BVHModel<BV>* obj1 = static_cast<
const BVHModel<BV>*>(o1);
171 const OcTree<S>* obj2 =
static_cast<const OcTree<S>*
>(o2);
172 OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver);
174 initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, request, result);
177 return result.min_distance;
180 template <
typename BV,
typename NarrowPhaseSolver>
181 typename BV::S OcTreeBVHDistance(
182 const CollisionGeometry<typename BV::S>* o1,
183 const Transform3<typename BV::S>& tf1,
184 const CollisionGeometry<typename BV::S>* o2,
185 const Transform3<typename BV::S>& tf2,
186 const NarrowPhaseSolver* nsolver,
187 const DistanceRequest<typename BV::S>& request,
188 DistanceResult<typename BV::S>& result)
190 using S =
typename BV::S;
192 if(request.isSatisfied(result))
return result.min_distance;
193 OcTreeMeshDistanceTraversalNode<BV, NarrowPhaseSolver> node;
194 const OcTree<S>* obj1 = static_cast<
const OcTree<S>*>(o1);
195 const BVHModel<BV>* obj2 =
static_cast<const BVHModel<BV>*
>(o2);
196 OcTreeSolver<NarrowPhaseSolver> otsolver(nsolver);
198 initialize(node, *obj1, tf1, *obj2, tf2, &otsolver, request, result);
201 return result.min_distance;
206 template <
typename Shape1,
typename Shape2,
typename NarrowPhaseSolver>
207 typename Shape1::S ShapeShapeDistance(
208 const CollisionGeometry<typename Shape1::S>* o1,
209 const Transform3<typename Shape1::S>& tf1,
210 const CollisionGeometry<typename Shape1::S>* o2,
211 const Transform3<typename Shape1::S>& tf2,
212 const NarrowPhaseSolver* nsolver,
213 const DistanceRequest<typename Shape1::S>& request,
214 DistanceResult<typename Shape1::S>& result)
216 if(request.isSatisfied(result))
return result.min_distance;
217 ShapeDistanceTraversalNode<Shape1, Shape2, NarrowPhaseSolver> node;
218 const Shape1* obj1 = static_cast<const Shape1*>(o1);
219 const Shape2* obj2 =
static_cast<const Shape2*
>(o2);
221 initialize(node, *obj1, tf1, *obj2, tf2, nsolver, request, result);
224 return result.min_distance;
227 template <
typename BV,
typename Shape,
typename NarrowPhaseSolver>
230 using S =
typename BV::S;
234 const Transform3<S>& tf1,
236 const Transform3<S>& tf2,
237 const NarrowPhaseSolver* nsolver,
241 if(request.isSatisfied(result))
return result.
min_distance;
245 Transform3<S> tf1_tmp = tf1;
246 const Shape* obj2 =
static_cast<const Shape*
>(o2);
248 initialize(node, *obj1_tmp, tf1_tmp, *obj2, tf2, nsolver, request, result);
249 ::fcl::distance(&node);
256 template <
typename OrientedMeshShapeDistanceTraversalNode,
257 typename BV,
typename Shape,
typename NarrowPhaseSolver>
258 typename Shape::S orientedBVHShapeDistance(
260 const Transform3<typename Shape::S>& tf1,
262 const Transform3<typename Shape::S>& tf2,
263 const NarrowPhaseSolver* nsolver,
267 if(request.isSatisfied(result))
return result.
min_distance;
268 OrientedMeshShapeDistanceTraversalNode node;
270 const Shape* obj2 =
static_cast<const Shape*
>(o2);
272 initialize(node, *obj1, tf1, *obj2, tf2, nsolver, request, result);
278 template <
typename Shape,
typename NarrowPhaseSolver>
283 const Transform3<typename Shape::S>& tf1,
285 const Transform3<typename Shape::S>& tf2,
286 const NarrowPhaseSolver* nsolver,
290 return detail::orientedBVHShapeDistance<
295 o1, tf1, o2, tf2, nsolver, request, result);
299 template <
typename Shape,
typename NarrowPhaseSolver>
304 const Transform3<typename Shape::S>& tf1,
306 const Transform3<typename Shape::S>& tf2,
307 const NarrowPhaseSolver* nsolver,
311 return detail::orientedBVHShapeDistance<
316 o1, tf1, o2, tf2, nsolver, request, result);
320 template <
typename Shape,
typename NarrowPhaseSolver>
325 const Transform3<typename Shape::S>& tf1,
327 const Transform3<typename Shape::S>& tf2,
328 const NarrowPhaseSolver* nsolver,
332 return detail::orientedBVHShapeDistance<
337 o1, tf1, o2, tf2, nsolver, request, result);
342 template <
typename S,
typename BV>
347 const Transform3<S>& tf1,
349 const Transform3<S>& tf2,
353 if(request.isSatisfied(result))
return result.
min_distance;
358 Transform3<S> tf1_tmp = tf1;
360 Transform3<S> tf2_tmp = tf2;
362 initialize(node, *obj1_tmp, tf1_tmp, *obj2_tmp, tf2_tmp, request, result);
372 template <
typename BV>
373 typename BV::S BVHDistance(
375 const Transform3<typename BV::S>& tf1,
377 const Transform3<typename BV::S>& tf2,
382 o1, tf1, o2, tf2, request, result);
385 template <
typename OrientedMeshDistanceTraversalNode,
typename BV>
386 typename BV::S orientedMeshDistance(
388 const Transform3<typename BV::S>& tf1,
390 const Transform3<typename BV::S>& tf2,
394 if(request.isSatisfied(result))
return result.
min_distance;
395 OrientedMeshDistanceTraversalNode node;
399 initialize(node, *obj1, tf1, *obj2, tf2, request, result);
406 template <
typename S>
411 const Transform3<S>& tf1,
413 const Transform3<S>& tf2,
417 return detail::orientedMeshDistance<
419 o1, tf1, o2, tf2, request, result);
424 template <
typename S>
429 const Transform3<S>& tf1,
431 const Transform3<S>& tf2,
435 return detail::orientedMeshDistance<
437 o1, tf1, o2, tf2, request, result);
442 template <
typename S>
447 const Transform3<S>& tf1,
449 const Transform3<S>& tf2,
453 return detail::orientedMeshDistance<
455 o1, tf1, o2, tf2, request, result);
460 template <
typename BV,
typename NarrowPhaseSolver>
461 typename BV::S BVHDistance(
463 const Transform3<typename BV::S>& tf1,
465 const Transform3<typename BV::S>& tf2,
466 const NarrowPhaseSolver* nsolver,
470 return BVHDistance<BV>(o1, tf1, o2, tf2, request, result);
473 template <
typename NarrowPhaseSolver>
476 for(
int i = 0; i < NODE_COUNT; ++i)
478 for(
int j = 0; j < NODE_COUNT; ++j)
479 distance_matrix[i][j] =
nullptr;
482 distance_matrix[GEOM_BOX][GEOM_BOX] = &ShapeShapeDistance<Box<S>,
Box<S>, NarrowPhaseSolver>;
483 distance_matrix[GEOM_BOX][GEOM_SPHERE] = &ShapeShapeDistance<Box<S>,
Sphere<S>, NarrowPhaseSolver>;
484 distance_matrix[GEOM_BOX][GEOM_ELLIPSOID] = &ShapeShapeDistance<Box<S>,
Ellipsoid<S>, NarrowPhaseSolver>;
485 distance_matrix[GEOM_BOX][GEOM_CAPSULE] = &ShapeShapeDistance<Box<S>,
Capsule<S>, NarrowPhaseSolver>;
486 distance_matrix[GEOM_BOX][GEOM_CONE] = &ShapeShapeDistance<Box<S>,
Cone<S>, NarrowPhaseSolver>;
487 distance_matrix[GEOM_BOX][GEOM_CYLINDER] = &ShapeShapeDistance<Box<S>,
Cylinder<S>, NarrowPhaseSolver>;
488 distance_matrix[GEOM_BOX][GEOM_CONVEX] = &ShapeShapeDistance<Box<S>,
Convex<S>, NarrowPhaseSolver>;
489 distance_matrix[GEOM_BOX][GEOM_PLANE] = &ShapeShapeDistance<Box<S>,
Plane<S>, NarrowPhaseSolver>;
490 distance_matrix[GEOM_BOX][GEOM_HALFSPACE] = &ShapeShapeDistance<Box<S>,
Halfspace<S>, NarrowPhaseSolver>;
492 distance_matrix[GEOM_SPHERE][GEOM_BOX] = &ShapeShapeDistance<Sphere<S>, Box<S>, NarrowPhaseSolver>;
493 distance_matrix[GEOM_SPHERE][GEOM_SPHERE] = &ShapeShapeDistance<Sphere<S>, Sphere<S>, NarrowPhaseSolver>;
494 distance_matrix[GEOM_SPHERE][GEOM_ELLIPSOID] = &ShapeShapeDistance<Sphere<S>, Ellipsoid<S>, NarrowPhaseSolver>;
495 distance_matrix[GEOM_SPHERE][GEOM_CAPSULE] = &ShapeShapeDistance<Sphere<S>, Capsule<S>, NarrowPhaseSolver>;
496 distance_matrix[GEOM_SPHERE][GEOM_CONE] = &ShapeShapeDistance<Sphere<S>, Cone<S>, NarrowPhaseSolver>;
497 distance_matrix[GEOM_SPHERE][GEOM_CYLINDER] = &ShapeShapeDistance<Sphere<S>, Cylinder<S>, NarrowPhaseSolver>;
498 distance_matrix[GEOM_SPHERE][GEOM_CONVEX] = &ShapeShapeDistance<Sphere<S>, Convex<S>, NarrowPhaseSolver>;
499 distance_matrix[GEOM_SPHERE][GEOM_PLANE] = &ShapeShapeDistance<Sphere<S>, Plane<S>, NarrowPhaseSolver>;
500 distance_matrix[GEOM_SPHERE][GEOM_HALFSPACE] = &ShapeShapeDistance<Sphere<S>, Halfspace<S>, NarrowPhaseSolver>;
502 distance_matrix[GEOM_ELLIPSOID][GEOM_BOX] = &ShapeShapeDistance<Ellipsoid<S>, Box<S>, NarrowPhaseSolver>;
503 distance_matrix[GEOM_ELLIPSOID][GEOM_SPHERE] = &ShapeShapeDistance<Ellipsoid<S>, Sphere<S>, NarrowPhaseSolver>;
504 distance_matrix[GEOM_ELLIPSOID][GEOM_ELLIPSOID] = &ShapeShapeDistance<Ellipsoid<S>, Ellipsoid<S>, NarrowPhaseSolver>;
505 distance_matrix[GEOM_ELLIPSOID][GEOM_CAPSULE] = &ShapeShapeDistance<Ellipsoid<S>, Capsule<S>, NarrowPhaseSolver>;
506 distance_matrix[GEOM_ELLIPSOID][GEOM_CONE] = &ShapeShapeDistance<Ellipsoid<S>, Cone<S>, NarrowPhaseSolver>;
507 distance_matrix[GEOM_ELLIPSOID][GEOM_CYLINDER] = &ShapeShapeDistance<Ellipsoid<S>, Cylinder<S>, NarrowPhaseSolver>;
508 distance_matrix[GEOM_ELLIPSOID][GEOM_CONVEX] = &ShapeShapeDistance<Ellipsoid<S>, Convex<S>, NarrowPhaseSolver>;
509 distance_matrix[GEOM_ELLIPSOID][GEOM_PLANE] = &ShapeShapeDistance<Ellipsoid<S>, Plane<S>, NarrowPhaseSolver>;
510 distance_matrix[GEOM_ELLIPSOID][GEOM_HALFSPACE] = &ShapeShapeDistance<Ellipsoid<S>, Halfspace<S>, NarrowPhaseSolver>;
512 distance_matrix[GEOM_CAPSULE][GEOM_BOX] = &ShapeShapeDistance<Capsule<S>, Box<S>, NarrowPhaseSolver>;
513 distance_matrix[GEOM_CAPSULE][GEOM_SPHERE] = &ShapeShapeDistance<Capsule<S>, Sphere<S>, NarrowPhaseSolver>;
514 distance_matrix[GEOM_CAPSULE][GEOM_ELLIPSOID] = &ShapeShapeDistance<Capsule<S>, Ellipsoid<S>, NarrowPhaseSolver>;
515 distance_matrix[GEOM_CAPSULE][GEOM_CAPSULE] = &ShapeShapeDistance<Capsule<S>, Capsule<S>, NarrowPhaseSolver>;
516 distance_matrix[GEOM_CAPSULE][GEOM_CONE] = &ShapeShapeDistance<Capsule<S>, Cone<S>, NarrowPhaseSolver>;
517 distance_matrix[GEOM_CAPSULE][GEOM_CYLINDER] = &ShapeShapeDistance<Capsule<S>, Cylinder<S>, NarrowPhaseSolver>;
518 distance_matrix[GEOM_CAPSULE][GEOM_CONVEX] = &ShapeShapeDistance<Capsule<S>, Convex<S>, NarrowPhaseSolver>;
519 distance_matrix[GEOM_CAPSULE][GEOM_PLANE] = &ShapeShapeDistance<Capsule<S>, Plane<S>, NarrowPhaseSolver>;
520 distance_matrix[GEOM_CAPSULE][GEOM_HALFSPACE] = &ShapeShapeDistance<Capsule<S>, Halfspace<S>, NarrowPhaseSolver>;
522 distance_matrix[GEOM_CONE][GEOM_BOX] = &ShapeShapeDistance<Cone<S>, Box<S>, NarrowPhaseSolver>;
523 distance_matrix[GEOM_CONE][GEOM_SPHERE] = &ShapeShapeDistance<Cone<S>, Sphere<S>, NarrowPhaseSolver>;
524 distance_matrix[GEOM_CONE][GEOM_ELLIPSOID] = &ShapeShapeDistance<Cone<S>, Ellipsoid<S>, NarrowPhaseSolver>;
525 distance_matrix[GEOM_CONE][GEOM_CAPSULE] = &ShapeShapeDistance<Cone<S>, Capsule<S>, NarrowPhaseSolver>;
526 distance_matrix[GEOM_CONE][GEOM_CONE] = &ShapeShapeDistance<Cone<S>, Cone<S>, NarrowPhaseSolver>;
527 distance_matrix[GEOM_CONE][GEOM_CYLINDER] = &ShapeShapeDistance<Cone<S>, Cylinder<S>, NarrowPhaseSolver>;
528 distance_matrix[GEOM_CONE][GEOM_CONVEX] = &ShapeShapeDistance<Cone<S>, Convex<S>, NarrowPhaseSolver>;
529 distance_matrix[GEOM_CONE][GEOM_PLANE] = &ShapeShapeDistance<Cone<S>, Plane<S>, NarrowPhaseSolver>;
530 distance_matrix[GEOM_CONE][GEOM_HALFSPACE] = &ShapeShapeDistance<Cone<S>, Halfspace<S>, NarrowPhaseSolver>;
532 distance_matrix[GEOM_CYLINDER][GEOM_BOX] = &ShapeShapeDistance<Cylinder<S>, Box<S>, NarrowPhaseSolver>;
533 distance_matrix[GEOM_CYLINDER][GEOM_SPHERE] = &ShapeShapeDistance<Cylinder<S>, Sphere<S>, NarrowPhaseSolver>;
534 distance_matrix[GEOM_CYLINDER][GEOM_ELLIPSOID] = &ShapeShapeDistance<Cylinder<S>, Ellipsoid<S>, NarrowPhaseSolver>;
535 distance_matrix[GEOM_CYLINDER][GEOM_CAPSULE] = &ShapeShapeDistance<Cylinder<S>, Capsule<S>, NarrowPhaseSolver>;
536 distance_matrix[GEOM_CYLINDER][GEOM_CONE] = &ShapeShapeDistance<Cylinder<S>, Cone<S>, NarrowPhaseSolver>;
537 distance_matrix[GEOM_CYLINDER][GEOM_CYLINDER] = &ShapeShapeDistance<Cylinder<S>, Cylinder<S>, NarrowPhaseSolver>;
538 distance_matrix[GEOM_CYLINDER][GEOM_CONVEX] = &ShapeShapeDistance<Cylinder<S>, Convex<S>, NarrowPhaseSolver>;
539 distance_matrix[GEOM_CYLINDER][GEOM_PLANE] = &ShapeShapeDistance<Cylinder<S>, Plane<S>, NarrowPhaseSolver>;
540 distance_matrix[GEOM_CYLINDER][GEOM_HALFSPACE] = &ShapeShapeDistance<Cylinder<S>, Halfspace<S>, NarrowPhaseSolver>;
542 distance_matrix[GEOM_CONVEX][GEOM_BOX] = &ShapeShapeDistance<Convex<S>, Box<S>, NarrowPhaseSolver>;
543 distance_matrix[GEOM_CONVEX][GEOM_SPHERE] = &ShapeShapeDistance<Convex<S>, Sphere<S>, NarrowPhaseSolver>;
544 distance_matrix[GEOM_CONVEX][GEOM_ELLIPSOID] = &ShapeShapeDistance<Convex<S>, Ellipsoid<S>, NarrowPhaseSolver>;
545 distance_matrix[GEOM_CONVEX][GEOM_CAPSULE] = &ShapeShapeDistance<Convex<S>, Capsule<S>, NarrowPhaseSolver>;
546 distance_matrix[GEOM_CONVEX][GEOM_CONE] = &ShapeShapeDistance<Convex<S>, Cone<S>, NarrowPhaseSolver>;
547 distance_matrix[GEOM_CONVEX][GEOM_CYLINDER] = &ShapeShapeDistance<Convex<S>, Cylinder<S>, NarrowPhaseSolver>;
548 distance_matrix[GEOM_CONVEX][GEOM_CONVEX] = &ShapeShapeDistance<Convex<S>, Convex<S>, NarrowPhaseSolver>;
549 distance_matrix[GEOM_CONVEX][GEOM_PLANE] = &ShapeShapeDistance<Convex<S>, Plane<S>, NarrowPhaseSolver>;
550 distance_matrix[GEOM_CONVEX][GEOM_HALFSPACE] = &ShapeShapeDistance<Convex<S>, Halfspace<S>, NarrowPhaseSolver>;
552 distance_matrix[GEOM_PLANE][GEOM_BOX] = &ShapeShapeDistance<Plane<S>, Box<S>, NarrowPhaseSolver>;
553 distance_matrix[GEOM_PLANE][GEOM_SPHERE] = &ShapeShapeDistance<Plane<S>, Sphere<S>, NarrowPhaseSolver>;
554 distance_matrix[GEOM_PLANE][GEOM_ELLIPSOID] = &ShapeShapeDistance<Plane<S>, Ellipsoid<S>, NarrowPhaseSolver>;
555 distance_matrix[GEOM_PLANE][GEOM_CAPSULE] = &ShapeShapeDistance<Plane<S>, Capsule<S>, NarrowPhaseSolver>;
556 distance_matrix[GEOM_PLANE][GEOM_CONE] = &ShapeShapeDistance<Plane<S>, Cone<S>, NarrowPhaseSolver>;
557 distance_matrix[GEOM_PLANE][GEOM_CYLINDER] = &ShapeShapeDistance<Plane<S>, Cylinder<S>, NarrowPhaseSolver>;
558 distance_matrix[GEOM_PLANE][GEOM_CONVEX] = &ShapeShapeDistance<Plane<S>, Convex<S>, NarrowPhaseSolver>;
559 distance_matrix[GEOM_PLANE][GEOM_PLANE] = &ShapeShapeDistance<Plane<S>, Plane<S>, NarrowPhaseSolver>;
560 distance_matrix[GEOM_PLANE][GEOM_HALFSPACE] = &ShapeShapeDistance<Plane<S>, Halfspace<S>, NarrowPhaseSolver>;
562 distance_matrix[GEOM_HALFSPACE][GEOM_BOX] = &ShapeShapeDistance<Halfspace<S>, Box<S>, NarrowPhaseSolver>;
563 distance_matrix[GEOM_HALFSPACE][GEOM_SPHERE] = &ShapeShapeDistance<Halfspace<S>, Sphere<S>, NarrowPhaseSolver>;
564 distance_matrix[GEOM_HALFSPACE][GEOM_CAPSULE] = &ShapeShapeDistance<Halfspace<S>, Capsule<S>, NarrowPhaseSolver>;
565 distance_matrix[GEOM_HALFSPACE][GEOM_CONE] = &ShapeShapeDistance<Halfspace<S>, Cone<S>, NarrowPhaseSolver>;
566 distance_matrix[GEOM_HALFSPACE][GEOM_CYLINDER] = &ShapeShapeDistance<Halfspace<S>, Cylinder<S>, NarrowPhaseSolver>;
567 distance_matrix[GEOM_HALFSPACE][GEOM_CONVEX] = &ShapeShapeDistance<Halfspace<S>, Convex<S>, NarrowPhaseSolver>;
568 distance_matrix[GEOM_HALFSPACE][GEOM_PLANE] = &ShapeShapeDistance<Halfspace<S>, Plane<S>, NarrowPhaseSolver>;
569 distance_matrix[GEOM_HALFSPACE][GEOM_HALFSPACE] = &ShapeShapeDistance<Halfspace<S>, Halfspace<S>, NarrowPhaseSolver>;
657 distance_matrix[BV_AABB][BV_AABB] = &BVHDistance<AABB<S>, NarrowPhaseSolver>;
658 distance_matrix[BV_RSS][BV_RSS] = &BVHDistance<RSS<S>, NarrowPhaseSolver>;
659 distance_matrix[BV_kIOS][BV_kIOS] = &BVHDistance<kIOS<S>, NarrowPhaseSolver>;
660 distance_matrix[BV_OBBRSS][BV_OBBRSS] = &BVHDistance<OBBRSS<S>, NarrowPhaseSolver>;
663 distance_matrix[GEOM_OCTREE][GEOM_BOX] = &OcTreeShapeDistance<Box<S>, NarrowPhaseSolver>;
664 distance_matrix[GEOM_OCTREE][GEOM_SPHERE] = &OcTreeShapeDistance<Sphere<S>, NarrowPhaseSolver>;
665 distance_matrix[GEOM_OCTREE][GEOM_ELLIPSOID] = &OcTreeShapeDistance<Ellipsoid<S>, NarrowPhaseSolver>;
666 distance_matrix[GEOM_OCTREE][GEOM_CAPSULE] = &OcTreeShapeDistance<Capsule<S>, NarrowPhaseSolver>;
667 distance_matrix[GEOM_OCTREE][GEOM_CONE] = &OcTreeShapeDistance<Cone<S>, NarrowPhaseSolver>;
668 distance_matrix[GEOM_OCTREE][GEOM_CYLINDER] = &OcTreeShapeDistance<Cylinder<S>, NarrowPhaseSolver>;
669 distance_matrix[GEOM_OCTREE][GEOM_CONVEX] = &OcTreeShapeDistance<Convex<S>, NarrowPhaseSolver>;
670 distance_matrix[GEOM_OCTREE][GEOM_PLANE] = &OcTreeShapeDistance<Plane<S>, NarrowPhaseSolver>;
671 distance_matrix[GEOM_OCTREE][GEOM_HALFSPACE] = &OcTreeShapeDistance<Halfspace<S>, NarrowPhaseSolver>;
673 distance_matrix[GEOM_BOX][GEOM_OCTREE] = &ShapeOcTreeDistance<Box<S>, NarrowPhaseSolver>;
674 distance_matrix[GEOM_SPHERE][GEOM_OCTREE] = &ShapeOcTreeDistance<Sphere<S>, NarrowPhaseSolver>;
675 distance_matrix[GEOM_ELLIPSOID][GEOM_OCTREE] = &ShapeOcTreeDistance<Ellipsoid<S>, NarrowPhaseSolver>;
676 distance_matrix[GEOM_CAPSULE][GEOM_OCTREE] = &ShapeOcTreeDistance<Capsule<S>, NarrowPhaseSolver>;
677 distance_matrix[GEOM_CONE][GEOM_OCTREE] = &ShapeOcTreeDistance<Cone<S>, NarrowPhaseSolver>;
678 distance_matrix[GEOM_CYLINDER][GEOM_OCTREE] = &ShapeOcTreeDistance<Cylinder<S>, NarrowPhaseSolver>;
679 distance_matrix[GEOM_CONVEX][GEOM_OCTREE] = &ShapeOcTreeDistance<Convex<S>, NarrowPhaseSolver>;
680 distance_matrix[GEOM_PLANE][GEOM_OCTREE] = &ShapeOcTreeDistance<Plane<S>, NarrowPhaseSolver>;
681 distance_matrix[GEOM_HALFSPACE][GEOM_OCTREE] = &ShapeOcTreeDistance<Halfspace<S>, NarrowPhaseSolver>;
683 distance_matrix[GEOM_OCTREE][GEOM_OCTREE] = &OcTreeDistance<NarrowPhaseSolver>;
685 distance_matrix[GEOM_OCTREE][BV_AABB] = &OcTreeBVHDistance<AABB<S>, NarrowPhaseSolver>;
686 distance_matrix[GEOM_OCTREE][BV_OBB] = &OcTreeBVHDistance<OBB<S>, NarrowPhaseSolver>;
687 distance_matrix[GEOM_OCTREE][BV_RSS] = &OcTreeBVHDistance<RSS<S>, NarrowPhaseSolver>;
688 distance_matrix[GEOM_OCTREE][BV_OBBRSS] = &OcTreeBVHDistance<OBBRSS<S>, NarrowPhaseSolver>;
689 distance_matrix[GEOM_OCTREE][BV_kIOS] = &OcTreeBVHDistance<kIOS<S>, NarrowPhaseSolver>;
690 distance_matrix[GEOM_OCTREE][BV_KDOP16] = &OcTreeBVHDistance<KDOP<S, 16>, NarrowPhaseSolver>;
691 distance_matrix[GEOM_OCTREE][BV_KDOP18] = &OcTreeBVHDistance<KDOP<S, 18>, NarrowPhaseSolver>;
692 distance_matrix[GEOM_OCTREE][BV_KDOP24] = &OcTreeBVHDistance<KDOP<S, 24>, NarrowPhaseSolver>;
694 distance_matrix[BV_AABB][GEOM_OCTREE] = &BVHOcTreeDistance<AABB<S>, NarrowPhaseSolver>;
695 distance_matrix[BV_OBB][GEOM_OCTREE] = &BVHOcTreeDistance<OBB<S>, NarrowPhaseSolver>;
696 distance_matrix[BV_RSS][GEOM_OCTREE] = &BVHOcTreeDistance<RSS<S>, NarrowPhaseSolver>;
697 distance_matrix[BV_OBBRSS][GEOM_OCTREE] = &BVHOcTreeDistance<OBBRSS<S>, NarrowPhaseSolver>;
698 distance_matrix[BV_kIOS][GEOM_OCTREE] = &BVHOcTreeDistance<kIOS<S>, NarrowPhaseSolver>;
699 distance_matrix[BV_KDOP16][GEOM_OCTREE] = &BVHOcTreeDistance<KDOP<S, 16>, NarrowPhaseSolver>;
700 distance_matrix[BV_KDOP18][GEOM_OCTREE] = &BVHOcTreeDistance<KDOP<S, 18>, NarrowPhaseSolver>;
701 distance_matrix[BV_KDOP24][GEOM_OCTREE] = &BVHOcTreeDistance<KDOP<S, 24>, NarrowPhaseSolver>;
S min_distance
minimum distance between two objects. if two objects are in collision, min_distance <= 0...
Definition: distance_result.h:56
Half Space: this is equivalent to the Planed in ODE. The separation plane is defined as n * x = d; Po...
Definition: halfspace.h:55
Main namespace.
Definition: broadphase_bruteforce-inl.h:45
distance matrix stores the functions for distance between different types of objects and provides a u...
Definition: distance_func_matrix.h:54
Traversal node for distance between mesh and shape.
Definition: mesh_shape_distance_traversal_node.h:52
distance result
Definition: distance_request.h:48
Center at zero point ellipsoid.
Definition: ellipsoid.h:48
Definition: mesh_distance_traversal_node.h:135
The geometry for the object for collision or distance computation.
Definition: collision_geometry.h:59
Definition: distance_func_matrix-inl.h:228
Definition: distance_func_matrix-inl.h:343
Center at zero point capsule.
Definition: capsule.h:48
Center at zero point, axis aligned box.
Definition: box.h:48
Definition: mesh_shape_distance_traversal_node.h:151
Infinite plane.
Definition: plane.h:48
A class describing the bounding hierarchy of a mesh model or a point cloud model (which is viewed as ...
Definition: BVH_model.h:57
Center at zero cylinder.
Definition: cylinder.h:48
Center at zero cone.
Definition: cone.h:48
S distance(const Eigen::MatrixBase< DerivedA > &R0, const Eigen::MatrixBase< DerivedB > &T0, const kIOS< S > &b1, const kIOS< S > &b2, Vector3< S > *P, Vector3< S > *Q)
Approximate distance between two kIOS bounding volumes.
Definition: kIOS-inl.h:266
Center at zero point sphere.
Definition: sphere.h:48
request to the distance computation
Definition: distance_request.h:52
A class describing the kIOS collision structure, which is a set of spheres.
Definition: kIOS.h:48
Traversal node for distance computation between two meshes.
Definition: mesh_distance_traversal_node.h:55