|
@@ -92,6 +92,7 @@ var BABYLON;
|
|
this.error = new Array(4);
|
|
this.error = new Array(4);
|
|
this.deleted = false;
|
|
this.deleted = false;
|
|
this.isDirty = false;
|
|
this.isDirty = false;
|
|
|
|
+ this.deletePending = false;
|
|
this.borderFactor = 0;
|
|
this.borderFactor = 0;
|
|
}
|
|
}
|
|
return DecimationTriangle;
|
|
return DecimationTriangle;
|
|
@@ -259,7 +260,16 @@ var BABYLON;
|
|
continue;
|
|
continue;
|
|
if (_this.isFlipped(v1, i0, p, deleted1, t.borderFactor, delTr))
|
|
if (_this.isFlipped(v1, i0, p, deleted1, t.borderFactor, delTr))
|
|
continue;
|
|
continue;
|
|
- if (delTr.length == 2 || delTr[0] === delTr[1]) {
|
|
|
|
|
|
+ if (deleted0.indexOf(true) < 0 || deleted1.indexOf(true) < 0)
|
|
|
|
+ continue;
|
|
|
|
+ var uniqueArray = [];
|
|
|
|
+ delTr.forEach(function (deletedT) {
|
|
|
|
+ if (uniqueArray.indexOf(deletedT) === -1) {
|
|
|
|
+ deletedT.deletePending = true;
|
|
|
|
+ uniqueArray.push(deletedT);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ if (uniqueArray.length % 2 != 0) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
v0.normal = n;
|
|
v0.normal = n;
|
|
@@ -268,10 +278,6 @@ var BABYLON;
|
|
else if (v0.color)
|
|
else if (v0.color)
|
|
v0.color = color;
|
|
v0.color = color;
|
|
v0.q = v1.q.add(v0.q);
|
|
v0.q = v1.q.add(v0.q);
|
|
- if (deleted0.indexOf(true) < 0 || deleted1.indexOf(true) < 0)
|
|
|
|
- continue;
|
|
|
|
- if (p.equals(v0.position))
|
|
|
|
- continue;
|
|
|
|
v0.position = p;
|
|
v0.position = p;
|
|
var tStart = _this.references.length;
|
|
var tStart = _this.references.length;
|
|
deletedTriangles = _this.updateTriangles(v0.id, v0, deleted0, deletedTriangles);
|
|
deletedTriangles = _this.updateTriangles(v0.id, v0, deleted0, deletedTriangles);
|
|
@@ -405,7 +411,7 @@ var BABYLON;
|
|
this.vertices[dst].normal = this.vertices[i].normal;
|
|
this.vertices[dst].normal = this.vertices[i].normal;
|
|
this.vertices[dst].uv = this.vertices[i].uv;
|
|
this.vertices[dst].uv = this.vertices[i].uv;
|
|
this.vertices[dst].color = this.vertices[i].color;
|
|
this.vertices[dst].color = this.vertices[i].color;
|
|
- newVerticesOrder.push(i);
|
|
|
|
|
|
+ newVerticesOrder.push(dst);
|
|
dst++;
|
|
dst++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -505,7 +511,7 @@ var BABYLON;
|
|
var t = this.triangles[ref.triangleId];
|
|
var t = this.triangles[ref.triangleId];
|
|
if (t.deleted)
|
|
if (t.deleted)
|
|
continue;
|
|
continue;
|
|
- if (deletedArray[i]) {
|
|
|
|
|
|
+ if (deletedArray[i] && t.deletePending) {
|
|
t.deleted = true;
|
|
t.deleted = true;
|
|
newDeleted++;
|
|
newDeleted++;
|
|
continue;
|
|
continue;
|