Fix faces to nodes projector

master
Jeremy Hu 2020-01-17 22:14:55 +09:30
parent 1844a897c4
commit 21fd758c48
1 changed files with 2 additions and 0 deletions

View File

@ -32,6 +32,8 @@ public:
auto B = -polygonNormal(*m_vertices, face);
auto a = QVector3D::dotProduct(B, B);
auto b = 2.0f * QVector3D::dotProduct(B, A - C);
if (b >= 0.0)
return false;
const auto &r = nodeRadius;
auto c = QVector3D::dotProduct(A - C, A - C) - r * r;
if (b * b - 4 * a * c <= 0)