38 #ifndef HPP_FCL_TRAVERSAL_NODE_OCTREE_H 39 #define HPP_FCL_TRAVERSAL_NODE_OCTREE_H 59 const GJKSolver* solver;
61 mutable const CollisionRequest* crequest;
62 mutable const DistanceRequest* drequest;
64 mutable CollisionResult* cresult;
65 mutable DistanceResult* dresult;
68 OcTreeSolver(
const GJKSolver* solver_) : solver(solver_),
77 void OcTreeIntersect(
const OcTree* tree1,
const OcTree* tree2,
78 const Transform3f& tf1,
const Transform3f& tf2,
79 const CollisionRequest& request_,
80 CollisionResult& result_)
const 85 OcTreeIntersectRecurse(tree1, tree1->getRoot(), tree1->getRootBV(),
86 tree2, tree2->getRoot(), tree2->getRootBV(),
91 void OcTreeDistance(
const OcTree* tree1,
const OcTree* tree2,
92 const Transform3f& tf1,
const Transform3f& tf2,
93 const DistanceRequest& request_,
94 DistanceResult& result_)
const 99 OcTreeDistanceRecurse(tree1, tree1->getRoot(), tree1->getRootBV(),
100 tree2, tree2->getRoot(), tree2->getRootBV(),
105 template<
typename BV>
106 void OcTreeMeshIntersect(
const OcTree* tree1,
const BVHModel<BV>* tree2,
107 const Transform3f& tf1,
const Transform3f& tf2,
108 const CollisionRequest& request_,
109 CollisionResult& result_)
const 111 crequest = &request_;
114 OcTreeMeshIntersectRecurse(tree1, tree1->getRoot(), tree1->getRootBV(),
120 template<
typename BV>
121 void OcTreeMeshDistance(
const OcTree* tree1,
const BVHModel<BV>* tree2,
122 const Transform3f& tf1,
const Transform3f& tf2,
123 const DistanceRequest& request_,
124 DistanceResult& result_)
const 126 drequest = &request_;
129 OcTreeMeshDistanceRecurse(tree1, tree1->getRoot(), tree1->getRootBV(),
135 template<
typename BV>
136 void MeshOcTreeIntersect(
const BVHModel<BV>* tree1,
const OcTree* tree2,
137 const Transform3f& tf1,
const Transform3f& tf2,
138 const CollisionRequest& request_,
139 CollisionResult& result_)
const 142 crequest = &request_;
145 OcTreeMeshIntersectRecurse(tree2, tree2->getRoot(), tree2->getRootBV(),
151 template<
typename BV>
152 void MeshOcTreeDistance(
const BVHModel<BV>* tree1,
const OcTree* tree2,
153 const Transform3f& tf1,
const Transform3f& tf2,
154 const DistanceRequest& request_,
155 DistanceResult& result_)
const 157 drequest = &request_;
160 OcTreeMeshDistanceRecurse(tree1, 0,
161 tree2, tree2->getRoot(), tree2->getRootBV(),
167 void OcTreeShapeIntersect(
const OcTree* tree,
const S& s,
168 const Transform3f& tf1,
const Transform3f& tf2,
169 const CollisionRequest& request_,
170 CollisionResult& result_)
const 172 crequest = &request_;
176 computeBV<AABB>(s, Transform3f(), bv2);
178 convertBV(bv2, tf2, obb2);
179 OcTreeShapeIntersectRecurse(tree, tree->getRoot(), tree->getRootBV(),
187 void ShapeOcTreeIntersect(
const S& s,
const OcTree* tree,
188 const Transform3f& tf1,
const Transform3f& tf2,
189 const CollisionRequest& request_,
190 CollisionResult& result_)
const 192 crequest = &request_;
196 computeBV<AABB>(s, Transform3f(), bv1);
198 convertBV(bv1, tf1, obb1);
199 OcTreeShapeIntersectRecurse(tree, tree->getRoot(), tree->getRootBV(),
206 void OcTreeShapeDistance(
const OcTree* tree,
const S& s,
207 const Transform3f& tf1,
const Transform3f& tf2,
208 const DistanceRequest& request_,
209 DistanceResult& result_)
const 211 drequest = &request_;
215 computeBV<AABB>(s, tf2, aabb2);
216 OcTreeShapeDistanceRecurse(tree, tree->getRoot(), tree->getRootBV(),
223 void ShapeOcTreeDistance(
const S& s,
const OcTree* tree,
224 const Transform3f& tf1,
const Transform3f& tf2,
225 const DistanceRequest& request_,
226 DistanceResult& result_)
const 228 drequest = &request_;
232 computeBV<AABB>(s, tf1, aabb1);
233 OcTreeShapeDistanceRecurse(tree, tree->getRoot(), tree->getRootBV(),
241 bool OcTreeShapeDistanceRecurse(
const OcTree* tree1,
const OcTree::OcTreeNode* root1,
const AABB& bv1,
242 const S& s,
const AABB& aabb2,
243 const Transform3f& tf1,
const Transform3f& tf2)
const 245 if(!tree1->nodeHasChildren(root1))
247 if(tree1->isNodeOccupied(root1))
254 Vec3f closest_p1, closest_p2, normal;
255 solver->shapeDistance(box, box_tf, s, tf2, dist, closest_p1,
258 dresult->update(dist, tree1, &s, (
int) (root1 - tree1->getRoot()),
262 return drequest->isSatisfied(*dresult);
268 if(!tree1->isNodeOccupied(root1))
return false;
270 for(
unsigned int i = 0; i < 8; ++i)
272 if(tree1->nodeChildExists(root1, i))
276 computeChildBV(bv1, i, child_bv);
279 convertBV(child_bv, tf1, aabb1);
281 if(d < dresult->min_distance)
283 if(OcTreeShapeDistanceRecurse(tree1, child, child_bv, s, aabb2, tf1, tf2))
293 bool OcTreeShapeIntersectRecurse(
const OcTree* tree1,
const OcTree::OcTreeNode* root1,
const AABB& bv1,
294 const S& s,
const OBB& obb2,
295 const Transform3f& tf1,
const Transform3f& tf2)
const 300 convertBV(bv1, tf1, obb1);
301 if(obb1.overlap(obb2))
308 if(solver->shapeIntersect(box, box_tf, s, tf2, distance,
false, NULL, NULL))
313 computeBV<AABB, S>(s, tf2, aabb2);
314 aabb1.overlap(aabb2, overlap_part);
320 else if(!tree1->nodeHasChildren(root1))
322 if(tree1->isNodeOccupied(root1))
325 convertBV(bv1, tf1, obb1);
326 if(obb1.overlap(obb2))
333 if(!crequest->enable_contact)
335 if(solver->shapeIntersect(box, box_tf, s, tf2, distance,
false, NULL, NULL))
337 if(cresult->numContacts() < crequest->num_max_contacts)
338 cresult->addContact(Contact(tree1, &s, static_cast<int>(root1 - tree1->getRoot()),
Contact::NONE));
346 if(solver->shapeIntersect(box, box_tf, s, tf2, distance,
true, &contact, &normal))
348 if(cresult->numContacts() < crequest->num_max_contacts)
349 cresult->addContact(Contact(tree1, &s, static_cast<int>(root1 - tree1->getRoot()),
Contact::NONE, contact, normal, distance));
353 return crequest->isSatisfied(*cresult);
364 if(tree1->isNodeFree(root1))
return false;
365 else if((tree1->isNodeUncertain(root1) || s.isUncertain()))
return false;
369 convertBV(bv1, tf1, obb1);
370 if(!obb1.overlap(obb2))
return false;
373 for(
unsigned int i = 0; i < 8; ++i)
375 if(tree1->nodeChildExists(root1, i))
379 computeChildBV(bv1, i, child_bv);
381 if(OcTreeShapeIntersectRecurse(tree1, child, child_bv, s, obb2, tf1, tf2))
389 template<
typename BV>
390 bool OcTreeMeshDistanceRecurse(
const OcTree* tree1,
const OcTree::OcTreeNode* root1,
const AABB& bv1,
391 const BVHModel<BV>* tree2,
int root2,
392 const Transform3f& tf1,
const Transform3f& tf2)
const 394 if(!tree1->nodeHasChildren(root1) && tree2->getBV(root2).isLeaf())
396 if(tree1->isNodeOccupied(root1))
402 int primitive_id = tree2->getBV(root2).primitiveId();
403 const Triangle& tri_id = tree2->tri_indices[primitive_id];
404 const Vec3f& p1 = tree2->vertices[tri_id[0]];
405 const Vec3f& p2 = tree2->vertices[tri_id[1]];
406 const Vec3f& p3 = tree2->vertices[tri_id[2]];
409 Vec3f closest_p1, closest_p2, normal;
410 solver->shapeTriangleInteraction(box, box_tf, p1, p2, p3, tf2, dist,
411 closest_p1, closest_p2, normal);
413 dresult->update(dist, tree1, tree2, (
int) (root1 - tree1->getRoot()),
414 primitive_id, closest_p1, closest_p2, normal);
416 return drequest->isSatisfied(*dresult);
422 if(!tree1->isNodeOccupied(root1))
return false;
424 if(tree2->getBV(root2).isLeaf() || (tree1->nodeHasChildren(root1) && (bv1.size() > tree2->getBV(root2).bv.size())))
426 for(
unsigned int i = 0; i < 8; ++i)
428 if(tree1->nodeChildExists(root1, i))
432 computeChildBV(bv1, i, child_bv);
436 convertBV(child_bv, tf1, aabb1);
437 convertBV(tree2->getBV(root2).bv, tf2, aabb2);
438 d = aabb1.distance(aabb2);
440 if(d < dresult->min_distance)
442 if(OcTreeMeshDistanceRecurse(tree1, child, child_bv, tree2, root2, tf1, tf2))
452 convertBV(bv1, tf1, aabb1);
453 int child = tree2->getBV(root2).leftChild();
454 convertBV(tree2->getBV(child).bv, tf2, aabb2);
455 d = aabb1.distance(aabb2);
457 if(d < dresult->min_distance)
459 if(OcTreeMeshDistanceRecurse(tree1, root1, bv1, tree2, child, tf1, tf2))
463 child = tree2->getBV(root2).rightChild();
464 convertBV(tree2->getBV(child).bv, tf2, aabb2);
465 d = aabb1.distance(aabb2);
467 if(d < dresult->min_distance)
469 if(OcTreeMeshDistanceRecurse(tree1, root1, bv1, tree2, child, tf1, tf2))
478 template<
typename BV>
479 bool OcTreeMeshIntersectRecurse(
const OcTree* tree1,
const OcTree::OcTreeNode* root1,
const AABB& bv1,
480 const BVHModel<BV>* tree2,
int root2,
481 const Transform3f& tf1,
const Transform3f& tf2)
const 485 if(tree2->getBV(root2).isLeaf())
488 convertBV(bv1, tf1, obb1);
489 convertBV(tree2->getBV(root2).bv, tf2, obb2);
490 if(obb1.overlap(obb2))
496 int primitive_id = tree2->getBV(root2).primitiveId();
497 const Triangle& tri_id = tree2->tri_indices[primitive_id];
498 const Vec3f& p1 = tree2->vertices[tri_id[0]];
499 const Vec3f& p2 = tree2->vertices[tri_id[1]];
500 const Vec3f& p3 = tree2->vertices[tri_id[2]];
501 Vec3f c1, c2, normal;
503 if(solver->shapeTriangleInteraction
504 (box, box_tf, p1, p2, p3, tf2, distance, c1, c2, normal))
509 AABB aabb2(tf2.transform(p1), tf2.transform(p2), tf2.transform(p3));
510 aabb1.overlap(aabb2, overlap_part);
518 if(OcTreeMeshIntersectRecurse(tree1, root1, bv1, tree2, tree2->getBV(root2).leftChild(), tf1, tf2))
521 if(OcTreeMeshIntersectRecurse(tree1, root1, bv1, tree2, tree2->getBV(root2).rightChild(), tf1, tf2))
527 else if(!tree1->nodeHasChildren(root1) && tree2->getBV(root2).isLeaf())
529 if(tree1->isNodeOccupied(root1))
532 convertBV(bv1, tf1, obb1);
533 convertBV(tree2->getBV(root2).bv, tf2, obb2);
534 if(obb1.overlap(obb2))
540 int primitive_id = tree2->getBV(root2).primitiveId();
541 const Triangle& tri_id = tree2->tri_indices[primitive_id];
542 const Vec3f& p1 = tree2->vertices[tri_id[0]];
543 const Vec3f& p2 = tree2->vertices[tri_id[1]];
544 const Vec3f& p3 = tree2->vertices[tri_id[2]];
546 if(!crequest->enable_contact)
548 Vec3f c1, c2, normal;
550 if(solver->shapeTriangleInteraction
551 (box, box_tf, p1, p2, p3, tf2, distance, c1, c2, normal))
553 if(cresult->numContacts() < crequest->num_max_contacts)
554 cresult->addContact(Contact(tree1, tree2,
555 (
int)(root1 - tree1->getRoot()),
565 if(solver->shapeTriangleInteraction(box, box_tf, p1, p2, p3, tf2,
566 distance, c1, c2, normal))
568 assert (crequest->security_margin == 0);
569 if(cresult->numContacts() < crequest->num_max_contacts)
571 (Contact(tree1, tree2, (
int) (root1 - tree1->getRoot()),
572 primitive_id, c1, normal, -distance));
576 return crequest->isSatisfied(*cresult);
588 if(tree1->isNodeFree(root1))
return false;
589 else if((tree1->isNodeUncertain(root1) || tree2->isUncertain()))
594 convertBV(bv1, tf1, obb1);
595 convertBV(tree2->getBV(root2).bv, tf2, obb2);
596 if(!obb1.overlap(obb2))
return false;
599 if(tree2->getBV(root2).isLeaf() || (tree1->nodeHasChildren(root1) && (bv1.size() > tree2->getBV(root2).bv.size())))
601 for(
unsigned int i = 0; i < 8; ++i)
603 if(tree1->nodeChildExists(root1, i))
607 computeChildBV(bv1, i, child_bv);
609 if(OcTreeMeshIntersectRecurse(tree1, child, child_bv, tree2, root2, tf1, tf2))
616 if(OcTreeMeshIntersectRecurse(tree1, root1, bv1, tree2, tree2->getBV(root2).leftChild(), tf1, tf2))
619 if(OcTreeMeshIntersectRecurse(tree1, root1, bv1, tree2, tree2->getBV(root2).rightChild(), tf1, tf2))
627 bool OcTreeDistanceRecurse(
const OcTree* tree1,
const OcTree::OcTreeNode* root1,
const AABB& bv1,
629 const Transform3f& tf1,
const Transform3f& tf2)
const 631 if(!tree1->nodeHasChildren(root1) && !tree2->nodeHasChildren(root2))
633 if(tree1->isNodeOccupied(root1) && tree2->isNodeOccupied(root2))
636 Transform3f box1_tf, box2_tf;
641 Vec3f closest_p1, closest_p2, normal;
642 solver->shapeDistance(box1, box1_tf, box2, box2_tf, dist, closest_p1,
645 dresult->update(dist, tree1, tree2, (
int) (root1 - tree1->getRoot()),
646 (
int) (root2 - tree2->getRoot()),
647 closest_p1, closest_p2, normal);
649 return drequest->isSatisfied(*dresult);
655 if(!tree1->isNodeOccupied(root1) || !tree2->isNodeOccupied(root2))
return false;
657 if(!tree2->nodeHasChildren(root2) || (tree1->nodeHasChildren(root1) && (bv1.size() > bv2.size())))
659 for(
unsigned int i = 0; i < 8; ++i)
661 if(tree1->nodeChildExists(root1, i))
665 computeChildBV(bv1, i, child_bv);
669 convertBV(bv1, tf1, aabb1);
670 convertBV(bv2, tf2, aabb2);
671 d = aabb1.distance(aabb2);
673 if(d < dresult->min_distance)
676 if(OcTreeDistanceRecurse(tree1, child, child_bv, tree2, root2, bv2, tf1, tf2))
684 for(
unsigned int i = 0; i < 8; ++i)
686 if(tree2->nodeChildExists(root2, i))
690 computeChildBV(bv2, i, child_bv);
694 convertBV(bv1, tf1, aabb1);
695 convertBV(bv2, tf2, aabb2);
696 d = aabb1.distance(aabb2);
698 if(d < dresult->min_distance)
700 if(OcTreeDistanceRecurse(tree1, root1, bv1, tree2, child, child_bv, tf1, tf2))
711 bool OcTreeIntersectRecurse(
const OcTree* tree1,
const OcTree::OcTreeNode* root1,
const AABB& bv1,
713 const Transform3f& tf1,
const Transform3f& tf2)
const 718 convertBV(bv1, tf1, obb1);
719 convertBV(bv2, tf2, obb2);
721 if(obb1.overlap(obb2))
724 Transform3f box1_tf, box2_tf;
732 aabb1.overlap(aabb2, overlap_part);
737 else if(!root1 && root2)
739 if(tree2->nodeHasChildren(root2))
741 for(
unsigned int i = 0; i < 8; ++i)
743 if(tree2->nodeChildExists(root2, i))
747 computeChildBV(bv2, i, child_bv);
748 if(OcTreeIntersectRecurse(tree1, NULL, bv1, tree2, child, child_bv, tf1, tf2))
754 computeChildBV(bv2, i, child_bv);
755 if(OcTreeIntersectRecurse(tree1, NULL, bv1, tree2, NULL, child_bv, tf1, tf2))
762 if(OcTreeIntersectRecurse(tree1, NULL, bv1, tree2, NULL, bv2, tf1, tf2))
768 else if(root1 && !root2)
770 if(tree1->nodeHasChildren(root1))
772 for(
unsigned int i = 0; i < 8; ++i)
774 if(tree1->nodeChildExists(root1, i))
778 computeChildBV(bv1, i, child_bv);
779 if(OcTreeIntersectRecurse(tree1, child, child_bv, tree2, NULL, bv2, tf1, tf2))
785 computeChildBV(bv1, i, child_bv);
786 if(OcTreeIntersectRecurse(tree1, NULL, child_bv, tree2, NULL, bv2, tf1, tf2))
793 if(OcTreeIntersectRecurse(tree1, NULL, bv1, tree2, NULL, bv2, tf1, tf2))
799 else if(!tree1->nodeHasChildren(root1) && !tree2->nodeHasChildren(root2))
801 if(tree1->isNodeOccupied(root1) && tree2->isNodeOccupied(root2))
803 if(!crequest->enable_contact)
806 convertBV(bv1, tf1, obb1);
807 convertBV(bv2, tf2, obb2);
809 if(obb1.overlap(obb2))
811 if(cresult->numContacts() < crequest->num_max_contacts)
812 cresult->addContact(Contact(tree1, tree2, static_cast<int>(root1 - tree1->getRoot()), static_cast<int>(root2 - tree2->getRoot())));
818 Transform3f box1_tf, box2_tf;
825 if(solver->shapeIntersect(box1, box1_tf, box2, box2_tf, distance,
true, &contact, &normal))
827 if(cresult->numContacts() < crequest->num_max_contacts)
828 cresult->addContact(Contact(tree1, tree2, static_cast<int>(root1 - tree1->getRoot()), static_cast<int>(root2 - tree2->getRoot()), contact, normal, distance));
832 return crequest->isSatisfied(*cresult);
841 if(tree1->isNodeFree(root1) || tree2->isNodeFree(root2))
return false;
842 else if((tree1->isNodeUncertain(root1) || tree2->isNodeUncertain(root2)))
847 convertBV(bv1, tf1, obb1);
848 convertBV(bv2, tf2, obb2);
849 if(!obb1.overlap(obb2))
return false;
852 if(!tree2->nodeHasChildren(root2) || (tree1->nodeHasChildren(root1) && (bv1.size() > bv2.size())))
854 for(
unsigned int i = 0; i < 8; ++i)
856 if(tree1->nodeChildExists(root1, i))
860 computeChildBV(bv1, i, child_bv);
862 if(OcTreeIntersectRecurse(tree1, child, child_bv,
871 for(
unsigned int i = 0; i < 8; ++i)
873 if(tree2->nodeChildExists(root2, i))
877 computeChildBV(bv2, i, child_bv);
879 if(OcTreeIntersectRecurse(tree1, root1, bv1,
880 tree2, child, child_bv,
895 class OcTreeCollisionTraversalNode :
public CollisionTraversalNodeBase
898 OcTreeCollisionTraversalNode(
const CollisionRequest& request) :
899 CollisionTraversalNodeBase (request)
907 bool BVDisjoints(
int,
int)
const 912 bool BVDisjoints(
int,
int,
FCL_REAL&)
const 917 void leafCollides(
int,
int,
FCL_REAL&)
const 919 otsolver->OcTreeIntersect(model1, model2, tf1, tf2, request, *result);
922 const OcTree* model1;
923 const OcTree* model2;
925 Transform3f tf1, tf2;
927 const OcTreeSolver* otsolver;
932 class ShapeOcTreeCollisionTraversalNode :
public CollisionTraversalNodeBase
935 ShapeOcTreeCollisionTraversalNode(
const CollisionRequest& request) :
936 CollisionTraversalNodeBase (request)
944 bool BVDisjoints(
int,
int)
const 949 bool BVDisjoints(
int,
int,
FCL_REAL&)
const 954 void leafCollides(
int,
int,
FCL_REAL&)
const 956 otsolver->OcTreeShapeIntersect(model2, *model1, tf2, tf1, request, *result);
960 const OcTree* model2;
962 Transform3f tf1, tf2;
964 const OcTreeSolver* otsolver;
970 class OcTreeShapeCollisionTraversalNode :
public CollisionTraversalNodeBase
973 OcTreeShapeCollisionTraversalNode(
const CollisionRequest& request) :
974 CollisionTraversalNodeBase (request)
982 bool BVDisjoints(
int,
int)
const 992 void leafCollides(
int,
int,
FCL_REAL&)
const 994 otsolver->OcTreeShapeIntersect(model1, *model2, tf1, tf2, request, *result);
997 const OcTree* model1;
1000 Transform3f tf1, tf2;
1002 const OcTreeSolver* otsolver;
1006 template<
typename BV>
1007 class MeshOcTreeCollisionTraversalNode :
public CollisionTraversalNodeBase
1010 MeshOcTreeCollisionTraversalNode(
const CollisionRequest& request) :
1011 CollisionTraversalNodeBase (request)
1019 bool BVDisjoints(
int,
int)
const 1024 bool BVDisjoints(
int,
int,
FCL_REAL&)
const 1029 void leafCollides(
int,
int,
FCL_REAL&)
const 1031 otsolver->OcTreeMeshIntersect(model2, model1, tf2, tf1, request, *result);
1034 const BVHModel<BV>* model1;
1035 const OcTree* model2;
1037 Transform3f tf1, tf2;
1039 const OcTreeSolver* otsolver;
1043 template<
typename BV>
1044 class OcTreeMeshCollisionTraversalNode :
public CollisionTraversalNodeBase
1047 OcTreeMeshCollisionTraversalNode(
const CollisionRequest& request) :
1048 CollisionTraversalNodeBase (request)
1056 bool BVDisjoints(
int,
int)
const 1061 bool BVDisjoints(
int,
int,
FCL_REAL&)
const 1066 void leafCollides(
int,
int,
FCL_REAL&)
const 1068 otsolver->OcTreeMeshIntersect(model1, model2, tf1, tf2, request, *result);
1071 const OcTree* model1;
1072 const BVHModel<BV>* model2;
1074 Transform3f tf1, tf2;
1076 const OcTreeSolver* otsolver;
1085 class OcTreeDistanceTraversalNode :
public DistanceTraversalNodeBase
1088 OcTreeDistanceTraversalNode()
1097 FCL_REAL BVDistanceLowerBound(
int,
int)
const 1102 bool BVDistanceLowerBound(
int,
int,
FCL_REAL&)
const 1107 void leafComputeDistance(
int,
int)
const 1109 otsolver->OcTreeDistance(model1, model2, tf1, tf2, request, *result);
1112 const OcTree* model1;
1113 const OcTree* model2;
1115 const OcTreeSolver* otsolver;
1121 template<
typename S>
1122 class ShapeOcTreeDistanceTraversalNode :
public DistanceTraversalNodeBase
1125 ShapeOcTreeDistanceTraversalNode()
1133 FCL_REAL BVDistanceLowerBound(
int,
int)
const 1138 void leafComputeDistance(
int,
int)
const 1140 otsolver->OcTreeShapeDistance(model2, *model1, tf2, tf1, request, *result);
1144 const OcTree* model2;
1146 const OcTreeSolver* otsolver;
1150 template<
typename S>
1151 class OcTreeShapeDistanceTraversalNode :
public DistanceTraversalNodeBase
1154 OcTreeShapeDistanceTraversalNode()
1162 FCL_REAL BVDistanceLowerBound(
int,
int)
const 1167 void leafComputeDistance(
int,
int)
const 1169 otsolver->OcTreeShapeDistance(model1, *model2, tf1, tf2, request, *result);
1172 const OcTree* model1;
1175 const OcTreeSolver* otsolver;
1179 template<
typename BV>
1180 class MeshOcTreeDistanceTraversalNode :
public DistanceTraversalNodeBase
1183 MeshOcTreeDistanceTraversalNode()
1191 FCL_REAL BVDistanceLowerBound(
int,
int)
const 1196 void leafComputeDistance(
int,
int)
const 1198 otsolver->OcTreeMeshDistance(model2, model1, tf2, tf1, request, *result);
1201 const BVHModel<BV>* model1;
1202 const OcTree* model2;
1204 const OcTreeSolver* otsolver;
1209 template<
typename BV>
1210 class OcTreeMeshDistanceTraversalNode :
public DistanceTraversalNodeBase
1213 OcTreeMeshDistanceTraversalNode()
1221 FCL_REAL BVDistanceLowerBound(
int,
int)
const 1226 void leafComputeDistance(
int,
int)
const 1228 otsolver->OcTreeMeshDistance(model1, model2, tf1, tf2, request, *result);
1231 const OcTree* model1;
1232 const BVHModel<BV>* model2;
1234 const OcTreeSolver* otsolver;
void computeBV< AABB, Box >(const Box &s, const Transform3f &tf, AABB &bv)
Main namespace.
Definition: AABB.h:43
octomap::OcTreeNode OcTreeNode
Definition: octree.h:68
FCL_REAL distance(const Matrix3f &R0, const Vec3f &T0, const kIOS &b1, const kIOS &b2, Vec3f *P=NULL, Vec3f *Q=NULL)
Approximate distance between two kIOS bounding volumes.
double FCL_REAL
Definition: data_types.h:68
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
Definition: data_types.h:73
void constructBox(const AABB &bv, Box &box, Transform3f &tf)
construct a box shape (with a configuration) from a given bounding volume
static const int NONE
invalid contact primitive information
Definition: collision_data.h:366