Skip to content

Commit

Permalink
octree: fix missing update of sqrDistLowerBound
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarpent committed Jun 5, 2022
1 parent 41e2dbb commit 74a052a
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions include/hpp/fcl/internal/traversal_node_octree.h
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,11 @@ class HPP_FCL_DLLAPI ShapeOcTreeCollisionTraversalNode
return false;
}

void leafCollides(unsigned int, unsigned int, FCL_REAL&) const {
void leafCollides(unsigned int, unsigned int,
FCL_REAL& sqrDistLowerBound) const {
otsolver->OcTreeShapeIntersect(model2, *model1, tf2, tf1, request, *result);
sqrDistLowerBound = std::max((FCL_REAL)0, result->distance_lower_bound);
sqrDistLowerBound *= sqrDistLowerBound;
}

const S* model1;
Expand Down Expand Up @@ -777,8 +780,11 @@ class HPP_FCL_DLLAPI OcTreeShapeCollisionTraversalNode
return false;
}

void leafCollides(unsigned int, unsigned int, FCL_REAL&) const {
void leafCollides(unsigned int, unsigned int,
FCL_REAL& sqrDistLowerBound) const {
otsolver->OcTreeShapeIntersect(model1, *model2, tf1, tf2, request, *result);
sqrDistLowerBound = std::max((FCL_REAL)0, result->distance_lower_bound);
sqrDistLowerBound *= sqrDistLowerBound;
}

const OcTree* model1;
Expand Down Expand Up @@ -808,8 +814,11 @@ class HPP_FCL_DLLAPI MeshOcTreeCollisionTraversalNode
return false;
}

void leafCollides(unsigned int, unsigned int, FCL_REAL&) const {
void leafCollides(unsigned int, unsigned int,
FCL_REAL& sqrDistLowerBound) const {
otsolver->OcTreeMeshIntersect(model2, model1, tf2, tf1, request, *result);
sqrDistLowerBound = std::max((FCL_REAL)0, result->distance_lower_bound);
sqrDistLowerBound *= sqrDistLowerBound;
}

const BVHModel<BV>* model1;
Expand Down Expand Up @@ -839,8 +848,12 @@ class HPP_FCL_DLLAPI OcTreeMeshCollisionTraversalNode
return false;
}

void leafCollides(unsigned int, unsigned int, FCL_REAL&) const {
void leafCollides(unsigned int, unsigned int,
FCL_REAL& sqrDistLowerBound) const {
std::cout << "leafCollides" << std::endl;
otsolver->OcTreeMeshIntersect(model1, model2, tf1, tf2, request, *result);
sqrDistLowerBound = std::max((FCL_REAL)0, result->distance_lower_bound);
sqrDistLowerBound *= sqrDistLowerBound;
}

const OcTree* model1;
Expand Down

0 comments on commit 74a052a

Please sign in to comment.