Raanan Weber 7 rokov pred
rodič
commit
09125b8cff

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 8635 - 8629
dist/preview release/babylon.d.ts


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 4 - 4
dist/preview release/babylon.js


+ 15 - 6
dist/preview release/babylon.max.js

@@ -24499,21 +24499,27 @@ var BABYLON;
             }
         };
         // Octrees
-        Scene.prototype.getWorldExtends = function () {
+        /**
+         * Get the world extend vectors with an optional filter
+         *
+         * @param {(mesh: AbstractMesh) => boolean} [filterPredicate] the predicate - which meshes should be included when calculating the world size
+         * @returns {{ min: Vector3; max: Vector3 }} min and max vectors
+         */
+        Scene.prototype.getWorldExtends = function (filterPredicate) {
             var min = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
             var max = new BABYLON.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
-            for (var index = 0; index < this.meshes.length; index++) {
-                var mesh = this.meshes[index];
+            filterPredicate = filterPredicate || (function () { return true; });
+            this.meshes.filter(filterPredicate).forEach(function (mesh) {
                 mesh.computeWorldMatrix(true);
                 if (!mesh.subMeshes || mesh.subMeshes.length === 0 || mesh.infiniteDistance) {
-                    continue;
+                    return;
                 }
                 var boundingInfo = mesh.getBoundingInfo();
                 var minBox = boundingInfo.boundingBox.minimumWorld;
                 var maxBox = boundingInfo.boundingBox.maximumWorld;
                 BABYLON.Tools.CheckExtends(minBox, min, max);
                 BABYLON.Tools.CheckExtends(maxBox, min, max);
-            }
+            });
             return {
                 min: min,
                 max: max
@@ -90082,13 +90088,16 @@ var BABYLON;
          * Get the scene sizes according to the setup.
          */
         EnvironmentHelper.prototype._getSceneSize = function () {
+            var _this = this;
             var groundSize = this._options.groundSize;
             var skyboxSize = this._options.skyboxSize;
             var rootPosition = this._options.rootPosition;
             if (!this._scene.meshes || this._scene.meshes.length === 1) {
                 return { groundSize: groundSize, skyboxSize: skyboxSize, rootPosition: rootPosition };
             }
-            var sceneExtends = this._scene.getWorldExtends();
+            var sceneExtends = this._scene.getWorldExtends(function (mesh) {
+                return (mesh !== _this._ground && mesh !== _this._rootMesh && mesh !== _this._skybox);
+            });
             var sceneDiagonal = sceneExtends.max.subtract(sceneExtends.min);
             if (this._options.sizeAuto) {
                 if (this._scene.activeCamera instanceof BABYLON.ArcRotateCamera &&

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 4 - 4
dist/preview release/babylon.worker.js


+ 15 - 6
dist/preview release/es6.js

@@ -24485,21 +24485,27 @@ var BABYLON;
             }
         };
         // Octrees
-        Scene.prototype.getWorldExtends = function () {
+        /**
+         * Get the world extend vectors with an optional filter
+         *
+         * @param {(mesh: AbstractMesh) => boolean} [filterPredicate] the predicate - which meshes should be included when calculating the world size
+         * @returns {{ min: Vector3; max: Vector3 }} min and max vectors
+         */
+        Scene.prototype.getWorldExtends = function (filterPredicate) {
             var min = new BABYLON.Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);
             var max = new BABYLON.Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);
-            for (var index = 0; index < this.meshes.length; index++) {
-                var mesh = this.meshes[index];
+            filterPredicate = filterPredicate || (function () { return true; });
+            this.meshes.filter(filterPredicate).forEach(function (mesh) {
                 mesh.computeWorldMatrix(true);
                 if (!mesh.subMeshes || mesh.subMeshes.length === 0 || mesh.infiniteDistance) {
-                    continue;
+                    return;
                 }
                 var boundingInfo = mesh.getBoundingInfo();
                 var minBox = boundingInfo.boundingBox.minimumWorld;
                 var maxBox = boundingInfo.boundingBox.maximumWorld;
                 BABYLON.Tools.CheckExtends(minBox, min, max);
                 BABYLON.Tools.CheckExtends(maxBox, min, max);
-            }
+            });
             return {
                 min: min,
                 max: max
@@ -90068,13 +90074,16 @@ var BABYLON;
          * Get the scene sizes according to the setup.
          */
         EnvironmentHelper.prototype._getSceneSize = function () {
+            var _this = this;
             var groundSize = this._options.groundSize;
             var skyboxSize = this._options.skyboxSize;
             var rootPosition = this._options.rootPosition;
             if (!this._scene.meshes || this._scene.meshes.length === 1) {
                 return { groundSize: groundSize, skyboxSize: skyboxSize, rootPosition: rootPosition };
             }
-            var sceneExtends = this._scene.getWorldExtends();
+            var sceneExtends = this._scene.getWorldExtends(function (mesh) {
+                return (mesh !== _this._ground && mesh !== _this._rootMesh && mesh !== _this._skybox);
+            });
             var sceneDiagonal = sceneExtends.max.subtract(sceneExtends.min);
             if (this._options.sizeAuto) {
                 if (this._scene.activeCamera instanceof BABYLON.ArcRotateCamera &&