Improve performance of mesh-forced assemblies.

pull/252/merge
EvilSpirit 2017-09-01 00:42:50 +07:00 committed by whitequark
parent c8fc033047
commit 025bb960c0
1 changed files with 8 additions and 4 deletions

View File

@ -357,10 +357,14 @@ void Group::GenerateShellAndMesh() {
// and corresponding slowdown. // and corresponding slowdown.
outm.RemoveDegenerateTriangles(); outm.RemoveDegenerateTriangles();
if(srcg->meshCombine != CombineAs::ASSEMBLE) {
// And make sure that the output mesh is vertex-to-vertex. // And make sure that the output mesh is vertex-to-vertex.
SKdNode *root = SKdNode::From(&outm); SKdNode *root = SKdNode::From(&outm);
root->SnapToMesh(&outm); root->SnapToMesh(&outm);
root->MakeMeshInto(&runningMesh); root->MakeMeshInto(&runningMesh);
} else {
runningMesh.MakeFromCopyOf(&outm);
}
outm.Clear(); outm.Clear();
thism.Clear(); thism.Clear();