Fix down-facing, ground-level building faces check for imprecise floating point values (#102)

0.2
Brian Chirls 2014-12-10 11:05:03 -05:00
rodzic 4b545158fc
commit 4b45e451c0
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -371,9 +371,11 @@
if (!minHeight && !options.preserveGroundFaces) {
// Remove down-facing floor faces
for (var i = geom.faces.length - 1; i >= 0; i--) {
if (geom.faces[i].normal.z === 1) {
if (Math.abs(geom.faces[i].normal.z - 1) < Number.EPSILON) {
geom.faces.splice(i, 1);
geom.faceVertexUvs[0].splice(i, 1);
} else {
}
}
}