Checking for zero exactly gives better solutions to QEF

This commit is contained in:
Matt Williams 2014-01-11 22:23:55 +00:00
parent 81ce31432c
commit 4e13f0afa5

View File

@ -69,7 +69,7 @@ namespace PolyVox
} }
edge.normal = (gA * edge.fraction + gB * (1.0f-edge.fraction)); edge.normal = (gA * edge.fraction + gB * (1.0f-edge.fraction));
if(edge.normal.lengthSquared() > 0.000001f) if(edge.normal.lengthSquared() != 0.0f)
{ {
edge.normal.normalise(); edge.normal.normalise();
} }
@ -141,7 +141,7 @@ namespace PolyVox
const auto& vertexPosition = evaluateQEF(matrix, vector, rows) + massPoint; const auto& vertexPosition = evaluateQEF(matrix, vector, rows) + massPoint;
if(cellVertexNormal.lengthSquared() > 0.000001f) if(cellVertexNormal.lengthSquared() != 0.0f)
{ {
cellVertexNormal.normalise(); cellVertexNormal.normalise();
} }