Quellcode durchsuchen

Adjusting async calls

Due to a long computation time (n*n searching for duplicates), reduces
the number of sync operations.
Raanan Weber vor 10 Jahren
Ursprung
Commit
a8a3cf91c2

+ 1 - 1
Babylon/Mesh/babylon.meshSimplification.js

@@ -341,7 +341,7 @@ var BABYLON;
             };
             //var totalVertices = mesh.getTotalVertices();
             var totalVertices = submesh.verticesCount;
-            BABYLON.AsyncLoop.SyncAsyncForLoop(totalVertices, this.syncIterations, vertexInit, function () {
+            BABYLON.AsyncLoop.SyncAsyncForLoop(totalVertices, this.syncIterations / 2, vertexInit, function () {
                 var indicesInit = function (i) {
                     var offset = (submesh.indexStart / 3) + i;
                     var pos = (offset * 3);

+ 1 - 1
Babylon/Mesh/babylon.meshSimplification.ts

@@ -431,7 +431,7 @@
             };
             //var totalVertices = mesh.getTotalVertices();
             var totalVertices = submesh.verticesCount;
-            AsyncLoop.SyncAsyncForLoop(totalVertices, this.syncIterations, vertexInit,() => {
+            AsyncLoop.SyncAsyncForLoop(totalVertices, this.syncIterations / 2, vertexInit,() => {
 
                 var indicesInit = (i) => {
                     var offset = (submesh.indexStart / 3) + i;