-
Notifications
You must be signed in to change notification settings - Fork 4
[algorithm] Remove projection operation on tip #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…thm- completely unnecessary
a7364a9 to
dde0315
Compare
epernod
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
| { | ||
| tipProx = projectOnTip(surfProx->getPosition(), itTip->element()).prox; | ||
| if (!tipProx) continue; | ||
| tipProx->normalize(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure this normalization was never useful for the rest of the algo?
if yes, ok for me. Let's double check ci as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does nothing. Check the implementation:
CollisionAlgorithm/src/CollisionAlgorithm/proximity/PointProximity.h
Lines 45 to 47 in d758a81
| bool isNormalized() const override { return true; } | |
| void normalize() override {} |
normalize() is empty and isNormalized() always returns true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hum... and is it normal that it is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it should be because the normalization simply corrects the projection by placing the proximity inside the simplex. I guess it's there because the projection can in fact shoot the new point outside the simplex. But the PointProximity is the most trivial case. Projecting on a point simply means "use that point".
Check the EdgeProximity implementation:
CollisionAlgorithm/src/CollisionAlgorithm/proximity/EdgeProximity.h
Lines 66 to 78 in d758a81
| bool isNormalized() const override { | |
| // if (m_f0+m_f1 != 1.0) return false; | |
| return m_f0>=0 && m_f0<=1 && | |
| m_f1>=0 && m_f1<=1; | |
| } | |
| void normalize() override { | |
| if (m_f1<0.0) m_f1 = 0.0; | |
| else if (m_f1>1.0) m_f1 = 1.0; | |
| m_f0 = 1.0-m_f1; | |
| } |
m_f0 and m_f1 are the bary coords.
It is not doing anything except computing the distance between two points, which we are not using.
Based on #88