Explorar o código

Including finer control over SceneOptimization

David catuhe %!s(int64=10) %!d(string=hai) anos
pai
achega
6b22d2f9ae

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 681 - 681
dist/preview release - alpha/babylon.2.2.d.ts


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 4 - 5
dist/preview release - alpha/babylon.2.2.js


+ 7 - 2
dist/preview release - alpha/babylon.2.2.max.js

@@ -29643,7 +29643,7 @@ var BABYLON;
                 }
                 return true;
             };
-            this.apply = function (scene) {
+            this.apply = function (scene, updateSelectionTree) {
                 var globalPool = scene.meshes.slice(0);
                 var globalLength = globalPool.length;
                 for (var index = 0; index < globalLength; index++) {
@@ -29677,7 +29677,12 @@ var BABYLON;
                     // Merge meshes
                     BABYLON.Mesh.MergeMeshes(currentPool);
                 }
-                if (MergeMeshesOptimization.UpdateSelectionTree) {
+                if (updateSelectionTree != undefined) {
+                    if (updateSelectionTree) {
+                        scene.createOrUpdateSelectionOctree();
+                    }
+                }
+                else if (MergeMeshesOptimization.UpdateSelectionTree) {
                     scene.createOrUpdateSelectionOctree();
                 }
                 return true;

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 8 - 9
dist/preview release - alpha/babylon.2.2.noworker.js


+ 7 - 2
src/Tools/babylon.sceneOptimizer.js

@@ -147,7 +147,7 @@ var BABYLON;
                 }
                 return true;
             };
-            this.apply = function (scene) {
+            this.apply = function (scene, updateSelectionTree) {
                 var globalPool = scene.meshes.slice(0);
                 var globalLength = globalPool.length;
                 for (var index = 0; index < globalLength; index++) {
@@ -181,7 +181,12 @@ var BABYLON;
                     // Merge meshes
                     BABYLON.Mesh.MergeMeshes(currentPool);
                 }
-                if (MergeMeshesOptimization.UpdateSelectionTree) {
+                if (updateSelectionTree != undefined) {
+                    if (updateSelectionTree) {
+                        scene.createOrUpdateSelectionOctree();
+                    }
+                }
+                else if (MergeMeshesOptimization.UpdateSelectionTree) {
                     scene.createOrUpdateSelectionOctree();
                 }
                 return true;

+ 7 - 2
src/Tools/babylon.sceneOptimizer.ts

@@ -121,7 +121,7 @@
             return true;
         }
 
-        public apply = (scene: Scene): boolean => {
+        public apply = (scene: Scene, updateSelectionTree?: boolean): boolean => {
 
             var globalPool = scene.meshes.slice(0);
             var globalLength = globalPool.length;
@@ -169,7 +169,12 @@
                 Mesh.MergeMeshes(currentPool);
             }
 
-            if (MergeMeshesOptimization.UpdateSelectionTree) {
+            if (updateSelectionTree != undefined) {
+                if (updateSelectionTree) {
+                    scene.createOrUpdateSelectionOctree();
+                }
+            }
+            else if (MergeMeshesOptimization.UpdateSelectionTree) {
                 scene.createOrUpdateSelectionOctree();
             }