Skip to content

Commit 9423090

Browse files
committed
[algorithm] rename the vector from the tip to the last coupling point
1 parent efc42ff commit 9423090

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/sofa/collisionAlgorithm/algorithm/InsertionAlgorithm.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ class InsertionAlgorithm : public BaseAlgorithm
186186
Operations::CreateCenterProximity::Operation::get(itTip->getTypeInfo());
187187
const BaseProximity::SPtr tipProx = createTipProximity(itTip->element());
188188

189-
const type::Vec3 ab = m_couplingPts.back()->getPosition() - tipProx->getPosition();
190-
if (ab.norm() > d_tipDistThreshold.getValue())
189+
const type::Vec3 tip2Pt = m_couplingPts.back()->getPosition() - tipProx->getPosition();
190+
if (tip2Pt.norm() > d_tipDistThreshold.getValue())
191191
{
192192
auto findClosestProxOnVol =
193193
Operations::FindClosestProximity::Operation::get(l_volGeom);
@@ -210,8 +210,7 @@ class InsertionAlgorithm : public BaseAlgorithm
210210
const type::Vec3 normal = (edgeProx->element()->getP1()->getPosition() -
211211
edgeProx->element()->getP0()->getPosition())
212212
.normalized();
213-
const SReal dotProd = dot(ab, normal);
214-
if (dotProd > 0.0) m_couplingPts.pop_back();
213+
if (dot(tip2Pt, normal) > 0.0) m_couplingPts.pop_back();
215214
}
216215

217216
auto findClosestProxOnShaft =

0 commit comments

Comments
 (0)