Commit 7f436317 authored by Lucile Remigy's avatar Lucile Remigy
Browse files

Start renaming of BVTesting

parent 075a5d7c
......@@ -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;
......
......@@ -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));
......
......@@ -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
......@@ -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);
}
......
......@@ -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;
......
......@@ -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();
}
......
......@@ -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);
......
......@@ -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);
......