David Catuhe 8 years ago
parent
commit
642524f830
22 changed files with 6308 additions and 6331 deletions
  1. 1560 1562
      dist/preview release/babylon.d.ts
  2. 35 35
      dist/preview release/babylon.js
  3. 8 12
      dist/preview release/babylon.max.js
  4. 1560 1562
      dist/preview release/babylon.module.d.ts
  5. 36 36
      dist/preview release/babylon.worker.js
  6. 1399 1401
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts
  7. 25 25
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js
  8. 4 10
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js
  9. 1399 1401
      dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts
  10. 1 1
      dist/preview release/gui/babylon.gui.min.js
  11. 263 263
      dist/preview release/inspector/babylon.inspector.bundle.js
  12. 3 3
      dist/preview release/inspector/babylon.inspector.min.js
  13. 2 2
      dist/preview release/loaders/babylon.glTF1FileLoader.min.js
  14. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  15. 2 2
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  16. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  17. 1 1
      dist/preview release/materialsLibrary/babylon.customMaterial.min.js
  18. 1 1
      dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js
  19. 1 1
      dist/preview release/materialsLibrary/babylon.waterMaterial.min.js
  20. 1 1
      dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js
  21. 1 1
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js
  22. 4 9
      src/Behaviors/Cameras/babylon.framingBehavior.ts

File diff suppressed because it is too large
+ 1560 - 1562
dist/preview release/babylon.d.ts


File diff suppressed because it is too large
+ 35 - 35
dist/preview release/babylon.js


+ 8 - 12
dist/preview release/babylon.max.js

@@ -67039,8 +67039,10 @@ var BABYLON;
             // Alpha test
             // Alpha test
             if (material && material.needAlphaTesting()) {
             if (material && material.needAlphaTesting()) {
                 var alphaTexture = material.getAlphaTestTexture();
                 var alphaTexture = material.getAlphaTestTexture();
-                this._effect.setTexture("diffuseSampler", alphaTexture);
-                this._effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix());
+                if (alphaTexture) {
+                    this._effect.setTexture("diffuseSampler", alphaTexture);
+                    this._effect.setMatrix("diffuseMatrix", alphaTexture.getTextureMatrix());
+                }
             }
             }
             engine.setZOffset(-this.zOffset);
             engine.setZOffset(-this.zOffset);
             mesh._processRendering(subMesh, this._effect, BABYLON.Material.TriangleFillMode, batch, hardwareInstancedRendering, function (isInstance, world) { _this._effect.setMatrix("world", world); });
             mesh._processRendering(subMesh, this._effect, BABYLON.Material.TriangleFillMode, batch, hardwareInstancedRendering, function (isInstance, world) { _this._effect.setMatrix("world", world); });
@@ -69762,7 +69764,7 @@ var BABYLON;
 (function (BABYLON) {
 (function (BABYLON) {
     var FramingBehavior = (function () {
     var FramingBehavior = (function () {
         function FramingBehavior() {
         function FramingBehavior() {
-            this._mode = FramingBehavior.IgnoreBoundsSizeMode;
+            this._mode = FramingBehavior.FitFrustumSidesMode;
             this._radiusScale = 1.0;
             this._radiusScale = 1.0;
             this._positionY = 0;
             this._positionY = 0;
             this._defaultElevation = 0.3;
             this._defaultElevation = 0.3;
@@ -69954,13 +69956,10 @@ var BABYLON;
          * Targets the given mesh and updates zoom level accordingly.
          * Targets the given mesh and updates zoom level accordingly.
          * @param mesh  The mesh to target.
          * @param mesh  The mesh to target.
          * @param radius Optional. If a cached radius position already exists, overrides default.
          * @param radius Optional. If a cached radius position already exists, overrides default.
-         * @param applyToLowerLimit Optional. Indicates if the calculated target radius should be applied to the
-         *		camera's lower radius limit too.
          * @param framingPositionY Position on mesh to center camera focus where 0 corresponds bottom of its bounding box and 1, the top
          * @param framingPositionY Position on mesh to center camera focus where 0 corresponds bottom of its bounding box and 1, the top
          * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
          * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
          */
          */
-        FramingBehavior.prototype.zoomOnMesh = function (mesh, radius, applyToLowerLimit, framingPositionY, focusOnOriginXZ) {
-            if (applyToLowerLimit === void 0) { applyToLowerLimit = true; }
+        FramingBehavior.prototype.zoomOnMesh = function (mesh, radius, framingPositionY, focusOnOriginXZ) {
             if (focusOnOriginXZ === void 0) { focusOnOriginXZ = false; }
             if (focusOnOriginXZ === void 0) { focusOnOriginXZ = false; }
             if (framingPositionY == null) {
             if (framingPositionY == null) {
                 framingPositionY = this._positionY;
                 framingPositionY = this._positionY;
@@ -69985,17 +69984,14 @@ var BABYLON;
                 var delta = 0.1;
                 var delta = 0.1;
                 if (this._mode === FramingBehavior.FitFrustumSidesMode) {
                 if (this._mode === FramingBehavior.FitFrustumSidesMode) {
                     var position = this._calculateLowerRadiusFromModelBoundingSphere(mesh);
                     var position = this._calculateLowerRadiusFromModelBoundingSphere(mesh);
-                    this._attachedCamera.lowerRadiusLimit = position - delta;
+                    this._attachedCamera.lowerRadiusLimit = mesh.getBoundingInfo().boundingSphere.radiusWorld + this._attachedCamera.minZ;
                     radius = position;
                     radius = position;
                 }
                 }
                 else if (this._mode === FramingBehavior.IgnoreBoundsSizeMode) {
                 else if (this._mode === FramingBehavior.IgnoreBoundsSizeMode) {
                     radius = this._calculateLowerRadiusFromModelBoundingSphere(mesh);
                     radius = this._calculateLowerRadiusFromModelBoundingSphere(mesh);
+                    this._attachedCamera.lowerRadiusLimit = this._attachedCamera.minZ;
                 }
                 }
             }
             }
-            if (applyToLowerLimit) {
-                this._attachedCamera.lowerRadiusLimit = mesh.getBoundingInfo().boundingSphere.radiusWorld;
-                ;
-            }
             // transition to new radius
             // transition to new radius
             if (!this._radiusTransition) {
             if (!this._radiusTransition) {
                 this._radiusTransition = BABYLON.Animation.CreateAnimation("radius", BABYLON.Animation.ANIMATIONTYPE_FLOAT, 60, FramingBehavior.EasingFunction);
                 this._radiusTransition = BABYLON.Animation.CreateAnimation("radius", BABYLON.Animation.ANIMATIONTYPE_FLOAT, 60, FramingBehavior.EasingFunction);

File diff suppressed because it is too large
+ 1560 - 1562
dist/preview release/babylon.module.d.ts


File diff suppressed because it is too large
+ 36 - 36
dist/preview release/babylon.worker.js


File diff suppressed because it is too large
+ 1399 - 1401
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


File diff suppressed because it is too large
+ 25 - 25
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 4 - 10
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -49737,7 +49737,7 @@ var BABYLON;
 (function (BABYLON) {
 (function (BABYLON) {
     var FramingBehavior = (function () {
     var FramingBehavior = (function () {
         function FramingBehavior() {
         function FramingBehavior() {
-            this._mode = FramingBehavior.IgnoreBoundsSizeMode;
+            this._mode = FramingBehavior.FitFrustumSidesMode;
             this._radiusScale = 1.0;
             this._radiusScale = 1.0;
             this._positionY = 0;
             this._positionY = 0;
             this._defaultElevation = 0.3;
             this._defaultElevation = 0.3;
@@ -49929,13 +49929,10 @@ var BABYLON;
          * Targets the given mesh and updates zoom level accordingly.
          * Targets the given mesh and updates zoom level accordingly.
          * @param mesh  The mesh to target.
          * @param mesh  The mesh to target.
          * @param radius Optional. If a cached radius position already exists, overrides default.
          * @param radius Optional. If a cached radius position already exists, overrides default.
-         * @param applyToLowerLimit Optional. Indicates if the calculated target radius should be applied to the
-         *		camera's lower radius limit too.
          * @param framingPositionY Position on mesh to center camera focus where 0 corresponds bottom of its bounding box and 1, the top
          * @param framingPositionY Position on mesh to center camera focus where 0 corresponds bottom of its bounding box and 1, the top
          * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
          * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
          */
          */
-        FramingBehavior.prototype.zoomOnMesh = function (mesh, radius, applyToLowerLimit, framingPositionY, focusOnOriginXZ) {
-            if (applyToLowerLimit === void 0) { applyToLowerLimit = true; }
+        FramingBehavior.prototype.zoomOnMesh = function (mesh, radius, framingPositionY, focusOnOriginXZ) {
             if (focusOnOriginXZ === void 0) { focusOnOriginXZ = false; }
             if (focusOnOriginXZ === void 0) { focusOnOriginXZ = false; }
             if (framingPositionY == null) {
             if (framingPositionY == null) {
                 framingPositionY = this._positionY;
                 framingPositionY = this._positionY;
@@ -49960,17 +49957,14 @@ var BABYLON;
                 var delta = 0.1;
                 var delta = 0.1;
                 if (this._mode === FramingBehavior.FitFrustumSidesMode) {
                 if (this._mode === FramingBehavior.FitFrustumSidesMode) {
                     var position = this._calculateLowerRadiusFromModelBoundingSphere(mesh);
                     var position = this._calculateLowerRadiusFromModelBoundingSphere(mesh);
-                    this._attachedCamera.lowerRadiusLimit = position - delta;
+                    this._attachedCamera.lowerRadiusLimit = mesh.getBoundingInfo().boundingSphere.radiusWorld + this._attachedCamera.minZ;
                     radius = position;
                     radius = position;
                 }
                 }
                 else if (this._mode === FramingBehavior.IgnoreBoundsSizeMode) {
                 else if (this._mode === FramingBehavior.IgnoreBoundsSizeMode) {
                     radius = this._calculateLowerRadiusFromModelBoundingSphere(mesh);
                     radius = this._calculateLowerRadiusFromModelBoundingSphere(mesh);
+                    this._attachedCamera.lowerRadiusLimit = this._attachedCamera.minZ;
                 }
                 }
             }
             }
-            if (applyToLowerLimit) {
-                this._attachedCamera.lowerRadiusLimit = mesh.getBoundingInfo().boundingSphere.radiusWorld;
-                ;
-            }
             // transition to new radius
             // transition to new radius
             if (!this._radiusTransition) {
             if (!this._radiusTransition) {
                 this._radiusTransition = BABYLON.Animation.CreateAnimation("radius", BABYLON.Animation.ANIMATIONTYPE_FLOAT, 60, FramingBehavior.EasingFunction);
                 this._radiusTransition = BABYLON.Animation.CreateAnimation("radius", BABYLON.Animation.ANIMATIONTYPE_FLOAT, 60, FramingBehavior.EasingFunction);

File diff suppressed because it is too large
+ 1399 - 1401
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js


File diff suppressed because it is too large
+ 263 - 263
dist/preview release/inspector/babylon.inspector.bundle.js


File diff suppressed because it is too large
+ 3 - 3
dist/preview release/inspector/babylon.inspector.min.js


File diff suppressed because it is too large
+ 2 - 2
dist/preview release/loaders/babylon.glTF1FileLoader.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


File diff suppressed because it is too large
+ 2 - 2
dist/preview release/loaders/babylon.glTFFileLoader.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.customMaterial.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.shadowOnlyMaterial.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/materialsLibrary/babylon.waterMaterial.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js


+ 4 - 9
src/Behaviors/Cameras/babylon.framingBehavior.ts

@@ -4,7 +4,7 @@ module BABYLON {
             return "Framing";
             return "Framing";
         }
         }
 
 
-        private _mode = FramingBehavior.IgnoreBoundsSizeMode;
+        private _mode = FramingBehavior.FitFrustumSidesMode;
         private _radiusScale = 1.0;
         private _radiusScale = 1.0;
         private _positionY = 0;
         private _positionY = 0;
         private _defaultElevation = 0.3;
         private _defaultElevation = 0.3;
@@ -201,12 +201,10 @@ module BABYLON {
 		 * Targets the given mesh and updates zoom level accordingly.
 		 * Targets the given mesh and updates zoom level accordingly.
 		 * @param mesh  The mesh to target.
 		 * @param mesh  The mesh to target.
 		 * @param radius Optional. If a cached radius position already exists, overrides default.
 		 * @param radius Optional. If a cached radius position already exists, overrides default.
-		 * @param applyToLowerLimit Optional. Indicates if the calculated target radius should be applied to the
-		 *		camera's lower radius limit too.
 		 * @param framingPositionY Position on mesh to center camera focus where 0 corresponds bottom of its bounding box and 1, the top
 		 * @param framingPositionY Position on mesh to center camera focus where 0 corresponds bottom of its bounding box and 1, the top
 		 * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
 		 * @param focusOnOriginXZ Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
 		 */
 		 */
-		public zoomOnMesh(mesh: AbstractMesh, radius?: number, applyToLowerLimit: boolean = true, framingPositionY?: number, focusOnOriginXZ: boolean = false): void {
+		public zoomOnMesh(mesh: AbstractMesh, radius?: number, framingPositionY?: number, focusOnOriginXZ: boolean = false): void {
 			if (framingPositionY == null) {
 			if (framingPositionY == null) {
 				framingPositionY = this._positionY;
 				framingPositionY = this._positionY;
 			}
 			}
@@ -236,17 +234,14 @@ module BABYLON {
 				let delta = 0.1;
 				let delta = 0.1;
 				if (this._mode === FramingBehavior.FitFrustumSidesMode) {
 				if (this._mode === FramingBehavior.FitFrustumSidesMode) {
 					let position = this._calculateLowerRadiusFromModelBoundingSphere(mesh);
 					let position = this._calculateLowerRadiusFromModelBoundingSphere(mesh);
-					this._attachedCamera.lowerRadiusLimit = position - delta;
+					this._attachedCamera.lowerRadiusLimit = mesh.getBoundingInfo().boundingSphere.radiusWorld + this._attachedCamera.minZ;
 					radius = position;
 					radius = position;
 				} else if (this._mode === FramingBehavior.IgnoreBoundsSizeMode) {
 				} else if (this._mode === FramingBehavior.IgnoreBoundsSizeMode) {
 					radius = this._calculateLowerRadiusFromModelBoundingSphere(mesh);
 					radius = this._calculateLowerRadiusFromModelBoundingSphere(mesh);
+					this._attachedCamera.lowerRadiusLimit = this._attachedCamera.minZ;
 				}
 				}
 			}
 			}
 
 
-			if (applyToLowerLimit) {
-				this._attachedCamera.lowerRadiusLimit = mesh.getBoundingInfo().boundingSphere.radiusWorld;;
-			}
-
 			// transition to new radius
 			// transition to new radius
 			if (!this._radiusTransition) {
 			if (!this._radiusTransition) {
 				this._radiusTransition = Animation.CreateAnimation("radius", Animation.ANIMATIONTYPE_FLOAT, 60, FramingBehavior.EasingFunction);
 				this._radiusTransition = Animation.CreateAnimation("radius", Animation.ANIMATIONTYPE_FLOAT, 60, FramingBehavior.EasingFunction);