Skip to content

Commit 3e29573

Browse files
committed
[operations] Wrongly defined return statements in point removal operation
1 parent 2fbd7ad commit 3e29573

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/sofa/collisionAlgorithm/operations/NeedleOperations.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@ bool prunePointsUsingEdges(std::vector<BaseProximity::SPtr>& couplingPts,
1717

1818
const type::Vec3 edgeDirection = tip - edgeBase;
1919

20-
if (couplingPts.empty()) return true;
20+
if (couplingPts.empty()) return false;
2121
const type::Vec3 tip2Pt = couplingPts.back()->getPosition() - tip;
2222

2323
// Positive dot product means the point is ahead of the tip
24-
if (dot(tip2Pt, edgeDirection) > 0_sreal) couplingPts.pop_back();
24+
if (dot(tip2Pt, edgeDirection) > 0_sreal)
25+
{
26+
couplingPts.pop_back();
27+
return true;
28+
}
2529

26-
return true;
30+
return false;
2731
}
2832

2933
int register_PrunePointsAheadOfTip_Edge =

0 commit comments

Comments
 (0)