diff --git a/include/hpp/fcl/traversal/traversal_node_base.h b/include/hpp/fcl/traversal/traversal_node_base.h index 918505de5e55d4f0678e8dad64603c96378559ba..b8d729c75d11235f08695501caa8acc4de2cdc68 100644 --- a/include/hpp/fcl/traversal/traversal_node_base.h +++ b/include/hpp/fcl/traversal/traversal_node_base.h @@ -139,10 +139,10 @@ public: /// @brief BV test between b1 and b2 /// \return a lower bound of the distance between the two BV. /// \note except for OBB, this method returns the distance. - virtual FCL_REAL BVTesting(int b1, int b2) const; + virtual FCL_REAL BVDisjoints(int b1, int b2) const; /// @brief Leaf test between node b1 and b2, if they are both leafs - virtual void leafTesting(int b1, int b2) const = 0; + virtual void leafCollides(int b1, int b2) const = 0; /// @brief Check whether the traversal can stop virtual bool canStop(FCL_REAL c) const; diff --git a/include/hpp/fcl/traversal/traversal_node_bvh_shape.h b/include/hpp/fcl/traversal/traversal_node_bvh_shape.h index d1f4f007b12e094c6becd3be1daf756a2ca4f73d..a426f8a61c3e39a0964098b16de97c9e0efaab59 100644 --- a/include/hpp/fcl/traversal/traversal_node_bvh_shape.h +++ b/include/hpp/fcl/traversal/traversal_node_bvh_shape.h @@ -166,7 +166,7 @@ public: } /// @brief BV culling test in one BVTT node - bool BVTesting(int b1, int /*b2*/) const + bool BVDisjoints(int b1, int /*b2*/) const { if(this->enable_statistics) this->num_bv_tests++; if (RTIsIdentity) @@ -180,7 +180,7 @@ public: /// \retval sqrDistLowerBound square of a lower bound of the minimal /// distance between bounding volumes. /// @brief BV culling test in one BVTT node - bool BVTesting(int b1, int /*b2*/, FCL_REAL& sqrDistLowerBound) const + bool BVDisjoints(int b1, int /*b2*/, FCL_REAL& sqrDistLowerBound) const { if(this->enable_statistics) this->num_bv_tests++; bool res; @@ -195,7 +195,7 @@ public: } /// @brief Intersection testing between leaves (one triangle and one shape) - void leafTesting(int b1, int /*b2*/, FCL_REAL& sqrDistLowerBound) const + void leafCollides(int b1, int /*b2*/, FCL_REAL& sqrDistLowerBound) const { if(this->enable_statistics) this->num_leaf_tests++; const BVNode<BV>& node = this->model1->getBV(b1); @@ -327,7 +327,7 @@ public: /// BV test between b1 and b2 /// \param b2 Bounding volumes to test, - bool BVTesting(int /*b1*/, int b2) const + bool BVDisjoints(int /*b1*/, int b2) const { if(this->enable_statistics) this->num_bv_tests++; if (RTIsIdentity) @@ -340,7 +340,7 @@ public: /// \param b2 Bounding volumes to test, /// \retval sqrDistLowerBound square of a lower bound of the minimal /// distance between bounding volumes. - bool BVTesting(int /*b1*/, int b2, FCL_REAL& sqrDistLowerBound) const + bool BVDisjoints(int /*b1*/, int b2, FCL_REAL& sqrDistLowerBound) const { if(this->enable_statistics) this->num_bv_tests++; bool res; @@ -355,7 +355,7 @@ public: } /// @brief Intersection testing between leaves (one shape and one triangle) - void leafTesting(int /*b1*/, int b2, FCL_REAL& sqrDistLowerBound) const + void leafCollides(int /*b1*/, int b2, FCL_REAL& sqrDistLowerBound) const { if(this->enable_statistics) this->num_leaf_tests++; const BVNode<BV>& node = this->model2->getBV(b2); @@ -493,7 +493,7 @@ public: } /// @brief BV culling test in one BVTT node - FCL_REAL BVTesting(int b1, int /*b2*/) const + FCL_REAL BVDisjoints(int b1, int /*b2*/) const { return model1->getBV(b1).bv.distance(model2_bv); } @@ -541,7 +541,7 @@ public: } /// @brief BV culling test in one BVTT node - FCL_REAL BVTesting(int b1, int b2) const + FCL_REAL BVDisjoints(int b1, int b2) const { return model1_bv.distance(model2->getBV(b2).bv); } @@ -573,7 +573,7 @@ public: } /// @brief Distance testing between leaves (one triangle and one shape) - void leafTesting(int b1, int /*b2*/) const + void leafCollides(int b1, int /*b2*/) const { if(this->enable_statistics) this->num_leaf_tests++; @@ -700,13 +700,13 @@ public: { } - FCL_REAL BVTesting(int b1, int /*b2*/) const + FCL_REAL BVDisjoints(int b1, int /*b2*/) const { if(this->enable_statistics) this->num_bv_tests++; return distance(this->tf1.getRotation(), this->tf1.getTranslation(), this->model2_bv, this->model1->getBV(b1).bv); } - void leafTesting(int b1, int b2) const + void leafCollides(int b1, int b2) const { details::meshShapeDistanceOrientedNodeLeafTesting(b1, b2, this->model1, *(this->model2), this->vertices, this->tri_indices, this->tf1, this->tf2, this->nsolver, this->enable_statistics, this->num_leaf_tests, this->request, *(this->result)); @@ -732,13 +732,13 @@ public: { } - FCL_REAL BVTesting(int b1, int /*b2*/) const + FCL_REAL BVDisjoints(int b1, int /*b2*/) const { if(this->enable_statistics) this->num_bv_tests++; return distance(this->tf1.getRotation(), this->tf1.getTranslation(), this->model2_bv, this->model1->getBV(b1).bv); } - void leafTesting(int b1, int b2) const + void leafCollides(int b1, int b2) const { details::meshShapeDistanceOrientedNodeLeafTesting(b1, b2, this->model1, *(this->model2), this->vertices, this->tri_indices, this->tf1, this->tf2, this->nsolver, this->enable_statistics, this->num_leaf_tests, this->request, *(this->result)); @@ -765,13 +765,13 @@ public: } - FCL_REAL BVTesting(int b1, int /*b2*/) const + FCL_REAL BVDisjoints(int b1, int /*b2*/) const { if(this->enable_statistics) this->num_bv_tests++; return distance(this->tf1.getRotation(), this->tf1.getTranslation(), this->model2_bv, this->model1->getBV(b1).bv); } - void leafTesting(int b1, int b2) const + void leafCollides(int b1, int b2) const { details::meshShapeDistanceOrientedNodeLeafTesting(b1, b2, this->model1, *(this->model2), this->vertices, this->tri_indices, this->tf1, this->tf2, this->nsolver, this->enable_statistics, this->num_leaf_tests, this->request, *(this->result)); @@ -796,7 +796,7 @@ public: } /// @brief Distance testing between leaves (one shape and one triangle) - void leafTesting(int b1, int b2) const + void leafCollides(int b1, int b2) const { if(this->enable_statistics) this->num_leaf_tests++; @@ -856,13 +856,13 @@ public: { } - FCL_REAL BVTesting(int b1, int b2) const + FCL_REAL BVDisjoints(int b1, int b2) const { if(this->enable_statistics) this->num_bv_tests++; return distance(this->tf2.getRotation(), this->tf2.getTranslation(), this->model1_bv, this->model2->getBV(b2).bv); } - void leafTesting(int b1, int b2) const + void leafCollides(int b1, int b2) const { details::meshShapeDistanceOrientedNodeLeafTesting(b2, b1, this->model2, *(this->model1), this->vertices, this->tri_indices, this->tf2, this->tf1, this->nsolver, this->enable_statistics, this->num_leaf_tests, this->request, *(this->result)); @@ -888,13 +888,13 @@ public: { } - FCL_REAL BVTesting(int b1, int b2) const + FCL_REAL BVDisjoints(int b1, int b2) const { if(this->enable_statistics) this->num_bv_tests++; return distance(this->tf2.getRotation(), this->tf2.getTranslation(), this->model1_bv, this->model2->getBV(b2).bv); } - void leafTesting(int b1, int b2) const + void leafCollides(int b1, int b2) const { details::meshShapeDistanceOrientedNodeLeafTesting(b2, b1, this->model2, *(this->model1), this->vertices, this->tri_indices, this->tf2, this->tf1, this->nsolver, this->enable_statistics, this->num_leaf_tests, this->request, *(this->result)); @@ -920,13 +920,13 @@ public: { } - FCL_REAL BVTesting(int b1, int b2) const + FCL_REAL BVDisjoints(int b1, int b2) const { if(this->enable_statistics) this->num_bv_tests++; return distance(this->tf2.getRotation(), this->tf2.getTranslation(), this->model1_bv, this->model2->getBV(b2).bv); } - void leafTesting(int b1, int b2) const + void leafCollides(int b1, int b2) const { details::meshShapeDistanceOrientedNodeLeafTesting(b2, b1, this->model2, *(this->model1), this->vertices, this->tri_indices, this->tf2, this->tf1, this->nsolver, this->enable_statistics, this->num_leaf_tests, this->request, *(this->result)); diff --git a/include/hpp/fcl/traversal/traversal_node_bvhs.h b/include/hpp/fcl/traversal/traversal_node_bvhs.h index 57e8a3f3576f8c705bf0669453811b6bbbe2afb0..ece16ee1ee8dc995a9419ea5de4911473234fc30 100644 --- a/include/hpp/fcl/traversal/traversal_node_bvhs.h +++ b/include/hpp/fcl/traversal/traversal_node_bvhs.h @@ -157,7 +157,7 @@ public: } /// @brief BV culling test in one BVTT node - bool BVTesting(int b1, int b2) const + bool BVDisjoints(int b1, int b2) const { if(this->enable_statistics) this->num_bv_tests++; if (RTIsIdentity) @@ -171,7 +171,7 @@ public: /// \param b1, b2 Bounding volumes to test, /// \retval sqrDistLowerBound square of a lower bound of the minimal /// distance between bounding volumes. - bool BVTesting(int b1, int b2, FCL_REAL& sqrDistLowerBound) const + bool BVDisjoints(int b1, int b2, FCL_REAL& sqrDistLowerBound) const { if(this->enable_statistics) this->num_bv_tests++; if (RTIsIdentity) @@ -200,7 +200,7 @@ public: /// \note If the distance between objects is less than the security margin, /// and the object are not colliding, the penetration depth is /// negative. - void leafTesting(int b1, int b2, FCL_REAL& sqrDistLowerBound) const + void leafCollides(int b1, int b2, FCL_REAL& sqrDistLowerBound) const { if(this->enable_statistics) this->num_leaf_tests++; @@ -361,7 +361,7 @@ public: } /// @brief BV culling test in one BVTT node - FCL_REAL BVTesting(int b1, int b2) const + FCL_REAL BVDisjoints(int b1, int b2) const { if(enable_statistics) num_bv_tests++; return details::DistanceTraversalBVTesting_impl<BV> @@ -397,7 +397,7 @@ public: } /// @brief Distance testing between leaves (two triangles) - void leafTesting(int b1, int b2) const + void leafCollides(int b1, int b2) const { if(this->enable_statistics) this->num_leaf_tests++; @@ -457,7 +457,7 @@ public: void postprocess(); - FCL_REAL BVTesting(int b1, int b2) const; + FCL_REAL BVDisjoints(int b1, int b2) const; void leafTesting(int b1, int b2) const; @@ -475,7 +475,7 @@ public: void postprocess(); - FCL_REAL BVTesting(int b1, int b2) const; + FCL_REAL BVDisjoints(int b1, int b2) const; void leafTesting(int b1, int b2) const; @@ -492,9 +492,9 @@ public: void postprocess(); - FCL_REAL BVTesting(int b1, int b2) const; + FCL_REAL BVDisjoints(int b1, int b2) const; - FCL_REAL BVTesting(int b1, int b2, FCL_REAL& sqrDistLowerBound) const; + FCL_REAL BVDisjoints(int b1, int b2, FCL_REAL& sqrDistLowerBound) const; void leafTesting(int b1, int b2) const; @@ -525,4 +525,4 @@ inline const Matrix3f& getBVAxes<OBBRSS>(const OBBRSS& bv) } // namespace hpp -#endif +#endif \ No newline at end of file diff --git a/include/hpp/fcl/traversal/traversal_node_octree.h b/include/hpp/fcl/traversal/traversal_node_octree.h index 5473ff5149ef7b6700dbffa02e71f02ac614bc89..296a60c242d9071c6f5b22b16f34f7eb3c36fb4e 100644 --- a/include/hpp/fcl/traversal/traversal_node_octree.h +++ b/include/hpp/fcl/traversal/traversal_node_octree.h @@ -903,17 +903,17 @@ public: otsolver = NULL; } - bool BVTesting(int, int) const + bool BVDisjoints(int, int) const { return false; } - bool BVTesting(int, int, FCL_REAL&) const + bool BVDisjoints(int, int, FCL_REAL&) const { return false; } - void leafTesting(int, int, FCL_REAL&) const + void leafCollides(int, int, FCL_REAL&) const { otsolver->OcTreeIntersect(model1, model2, tf1, tf2, request, *result); } @@ -940,17 +940,17 @@ public: } - FCL_REAL BVTesting(int, int) const + FCL_REAL BVDisjoints(int, int) const { return -1; } - bool BVTesting(int, int, FCL_REAL&) const + bool BVDisjoints(int, int, FCL_REAL&) const { return false; } - void leafTesting(int, int) const + void leafCollides(int, int) const { otsolver->OcTreeDistance(model1, model2, tf1, tf2, request, *result); } @@ -975,17 +975,17 @@ public: otsolver = NULL; } - bool BVTesting(int, int) const + bool BVDisjoints(int, int) const { return false; } - bool BVTesting(int, int, FCL_REAL&) const + bool BVDisjoints(int, int, FCL_REAL&) const { return false; } - void leafTesting(int, int, FCL_REAL&) const + void leafCollides(int, int, FCL_REAL&) const { otsolver->OcTreeShapeIntersect(model2, *model1, tf2, tf1, request, *result); } @@ -1012,17 +1012,17 @@ public: otsolver = NULL; } - bool BVTesting(int, int) const + bool BVDisjoints(int, int) const { return false; } - bool BVTesting(int, int, fcl::FCL_REAL&) const + bool BVDisjoints(int, int, fcl::FCL_REAL&) const { return false; } - void leafTesting(int, int, FCL_REAL&) const + void leafCollides(int, int, FCL_REAL&) const { otsolver->OcTreeShapeIntersect(model1, *model2, tf1, tf2, request, *result); } @@ -1048,12 +1048,12 @@ public: otsolver = NULL; } - FCL_REAL BVTesting(int, int) const + FCL_REAL BVDisjoints(int, int) const { return -1; } - void leafTesting(int, int) const + void leafCollides(int, int) const { otsolver->OcTreeShapeDistance(model2, *model1, tf2, tf1, request, *result); } @@ -1077,12 +1077,12 @@ public: otsolver = NULL; } - FCL_REAL BVTesting(int, int) const + FCL_REAL BVDisjoints(int, int) const { return -1; } - void leafTesting(int, int) const + void leafCollides(int, int) const { otsolver->OcTreeShapeDistance(model1, *model2, tf1, tf2, request, *result); } @@ -1107,17 +1107,17 @@ public: otsolver = NULL; } - bool BVTesting(int, int) const + bool BVDisjoints(int, int) const { return false; } - bool BVTesting(int, int, FCL_REAL&) const + bool BVDisjoints(int, int, FCL_REAL&) const { return false; } - void leafTesting(int, int, FCL_REAL&) const + void leafCollides(int, int, FCL_REAL&) const { otsolver->OcTreeMeshIntersect(model2, model1, tf2, tf1, request, *result); } @@ -1144,17 +1144,17 @@ public: otsolver = NULL; } - bool BVTesting(int, int) const + bool BVDisjoints(int, int) const { return false; } - bool BVTesting(int, int, FCL_REAL&) const + bool BVDisjoints(int, int, FCL_REAL&) const { return false; } - void leafTesting(int, int, FCL_REAL&) const + void leafCollides(int, int, FCL_REAL&) const { otsolver->OcTreeMeshIntersect(model1, model2, tf1, tf2, request, *result); } @@ -1180,12 +1180,12 @@ public: otsolver = NULL; } - FCL_REAL BVTesting(int, int) const + FCL_REAL BVDisjoints(int, int) const { return -1; } - void leafTesting(int, int) const + void leafCollides(int, int) const { otsolver->OcTreeMeshDistance(model2, model1, tf2, tf1, request, *result); } @@ -1210,12 +1210,12 @@ public: otsolver = NULL; } - FCL_REAL BVTesting(int, int) const + FCL_REAL BVDisjoints(int, int) const { return -1; } - void leafTesting(int, int) const + void leafCollides(int, int) const { otsolver->OcTreeMeshDistance(model1, model2, tf1, tf2, request, *result); } diff --git a/include/hpp/fcl/traversal/traversal_node_shapes.h b/include/hpp/fcl/traversal/traversal_node_shapes.h index 9ed5e4e7041288df079055f62aaab991bbb2edaf..3172b4c227a7b9f7e5a1420d5b8259d0c8bcfee2 100644 --- a/include/hpp/fcl/traversal/traversal_node_shapes.h +++ b/include/hpp/fcl/traversal/traversal_node_shapes.h @@ -67,19 +67,19 @@ public: } /// @brief BV culling test in one BVTT node - bool BVTesting(int, int) const + bool BVDisjoints(int, int) const { return false; } /// @brief BV culling test in one BVTT node - bool BVTesting(int, int, FCL_REAL&) const + bool BVDisjoints(int, int, FCL_REAL&) const { throw std::runtime_error ("Not implemented"); } /// @brief Intersection testing between leaves (two shapes) - void leafTesting(int, int, FCL_REAL&) const + void leafCollides(int, int, FCL_REAL&) const { bool is_collision = false; if(request.enable_contact) @@ -128,13 +128,13 @@ public: } /// @brief BV culling test in one BVTT node - FCL_REAL BVTesting(int, int) const + FCL_REAL BVDisjoints(int, int) const { return -1; // should not be used } /// @brief Distance testing between leaves (two shapes) - void leafTesting(int, int) const + void leafCollides(int, int) const { FCL_REAL distance; Vec3f closest_p1, closest_p2, normal; diff --git a/src/traversal/traversal_node_base.cpp b/src/traversal/traversal_node_base.cpp index a4bc4eac9dedfa7ecef2ede85ec0ed51ce8f6f68..3274692052a007db444065ae0bc0cc7c556827a2 100644 --- a/src/traversal/traversal_node_base.cpp +++ b/src/traversal/traversal_node_base.cpp @@ -97,7 +97,7 @@ DistanceTraversalNodeBase::~DistanceTraversalNodeBase() { } - FCL_REAL DistanceTraversalNodeBase::BVTesting(int /*b1*/, int /*b2*/) const + FCL_REAL DistanceTraversalNodeBase::BVDisjoints(int /*b1*/, int /*b2*/) const { return std::numeric_limits<FCL_REAL>::max(); } diff --git a/src/traversal/traversal_node_bvhs.cpp b/src/traversal/traversal_node_bvhs.cpp index 5fe97fa5a0eaf8b892e77971b24ca2854e8b02d2..f9cdc8ac578479205e05a40ee4bc752147b17018 100644 --- a/src/traversal/traversal_node_bvhs.cpp +++ b/src/traversal/traversal_node_bvhs.cpp @@ -152,7 +152,7 @@ void MeshDistanceTraversalNodeRSS::postprocess() details::distancePostprocessOrientedNode(model1, model2, tf1, request, *result); } -FCL_REAL MeshDistanceTraversalNodeRSS::BVTesting(int b1, int b2) const +FCL_REAL MeshDistanceTraversalNodeRSS::BVDisjoints(int b1, int b2) const { if(enable_statistics) num_bv_tests++; return distance(R, T, model1->getBV(b1).bv, model2->getBV(b2).bv); @@ -180,7 +180,7 @@ void MeshDistanceTraversalNodekIOS::postprocess() details::distancePostprocessOrientedNode(model1, model2, tf1, request, *result); } -FCL_REAL MeshDistanceTraversalNodekIOS::BVTesting(int b1, int b2) const +FCL_REAL MeshDistanceTraversalNodekIOS::BVDisjoints(int b1, int b2) const { if(enable_statistics) num_bv_tests++; return distance(R, T, model1->getBV(b1).bv, model2->getBV(b2).bv); @@ -208,7 +208,7 @@ void MeshDistanceTraversalNodeOBBRSS::postprocess() details::distancePostprocessOrientedNode(model1, model2, tf1, request, *result); } -FCL_REAL MeshDistanceTraversalNodeOBBRSS::BVTesting(int b1, int b2) const +FCL_REAL MeshDistanceTraversalNodeOBBRSS::BVDisjoints(int b1, int b2) const { if(enable_statistics) num_bv_tests++; return distance(R, T, model1->getBV(b1).bv, model2->getBV(b2).bv); diff --git a/src/traversal/traversal_recurse.cpp b/src/traversal/traversal_recurse.cpp index d041c158c787f9db447323eec11fb5d60f02e3db..07cad58902befbf6680bc40f5e9f45c4ac55469a 100644 --- a/src/traversal/traversal_recurse.cpp +++ b/src/traversal/traversal_recurse.cpp @@ -169,7 +169,7 @@ void distanceRecurse(DistanceTraversalNodeBase* node, int b1, int b2, BVHFrontLi { updateFrontList(front_list, b1, b2); - node->leafTesting(b1, b2); + node->leafCollides(b1, b2); return; } @@ -190,8 +190,8 @@ void distanceRecurse(DistanceTraversalNodeBase* node, int b1, int b2, BVHFrontLi c2 = node->getSecondRightChild(b2); } - FCL_REAL d1 = node->BVTesting(a1, a2); - FCL_REAL d2 = node->BVTesting(c1, c2); + FCL_REAL d1 = node->BVDisjoints(a1, a2); + FCL_REAL d2 = node->BVDisjoints(c1, c2); if(d2 < d1) { @@ -298,7 +298,7 @@ void distanceQueueRecurse(DistanceTraversalNodeBase* node, int b1, int b2, BVHFr { updateFrontList(front_list, min_test.b1, min_test.b2); - node->leafTesting(min_test.b1, min_test.b2); + node->leafCollides(min_test.b1, min_test.b2); } else if(bvtq.full()) { @@ -317,11 +317,11 @@ void distanceQueueRecurse(DistanceTraversalNodeBase* node, int b1, int b2, BVHFr int c2 = node->getFirstRightChild(min_test.b1); bvt1.b1 = c1; bvt1.b2 = min_test.b2; - bvt1.d = node->BVTesting(bvt1.b1, bvt1.b2); + bvt1.d = node->BVDisjoints(bvt1.b1, bvt1.b2); bvt2.b1 = c2; bvt2.b2 = min_test.b2; - bvt2.d = node->BVTesting(bvt2.b1, bvt2.b2); + bvt2.d = node->BVDisjoints(bvt2.b1, bvt2.b2); } else { @@ -329,11 +329,11 @@ void distanceQueueRecurse(DistanceTraversalNodeBase* node, int b1, int b2, BVHFr int c2 = node->getSecondRightChild(min_test.b2); bvt1.b1 = min_test.b1; bvt1.b2 = c1; - bvt1.d = node->BVTesting(bvt1.b1, bvt1.b2); + bvt1.d = node->BVDisjoints(bvt1.b1, bvt1.b2); bvt2.b1 = min_test.b1; bvt2.b2 = c2; - bvt2.d = node->BVTesting(bvt2.b1, bvt2.b2); + bvt2.d = node->BVDisjoints(bvt2.b1, bvt2.b2); } bvtq.push(bvt1); @@ -378,7 +378,7 @@ void propagateBVHFrontListCollisionRecurse } else { - if(!node->BVTesting(b1, b2, sqrDistLowerBound)) { + if(!node->BVDisjoints(b1, b2, sqrDistLowerBound)) { front_iter->valid = false; if(node->firstOverSecond(b1, b2)) { int c1 = node->getFirstLeftChild(b1);