David Catuhe 8 years ago
parent
commit
54282520c5

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


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


+ 3 - 0
dist/preview release/babylon.max.js

@@ -34982,6 +34982,9 @@ var BABYLON;
         ArcRotateCamera.prototype.rebuildAnglesAndRadius = function () {
         ArcRotateCamera.prototype.rebuildAnglesAndRadius = function () {
             var radiusv3 = this.position.subtract(this._getTargetPosition());
             var radiusv3 = this.position.subtract(this._getTargetPosition());
             this.radius = radiusv3.length();
             this.radius = radiusv3.length();
+            if (this.radius === 0) {
+                this.radius = 0.0001; // Just to avoid division by zero
+            }
             // Alpha
             // Alpha
             this.alpha = Math.acos(radiusv3.x / Math.sqrt(Math.pow(radiusv3.x, 2) + Math.pow(radiusv3.z, 2)));
             this.alpha = Math.acos(radiusv3.x / Math.sqrt(Math.pow(radiusv3.x, 2) + Math.pow(radiusv3.z, 2)));
             if (radiusv3.z < 0) {
             if (radiusv3.z < 0) {

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


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


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


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


+ 3 - 0
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -32078,6 +32078,9 @@ var BABYLON;
         ArcRotateCamera.prototype.rebuildAnglesAndRadius = function () {
         ArcRotateCamera.prototype.rebuildAnglesAndRadius = function () {
             var radiusv3 = this.position.subtract(this._getTargetPosition());
             var radiusv3 = this.position.subtract(this._getTargetPosition());
             this.radius = radiusv3.length();
             this.radius = radiusv3.length();
+            if (this.radius === 0) {
+                this.radius = 0.0001; // Just to avoid division by zero
+            }
             // Alpha
             // Alpha
             this.alpha = Math.acos(radiusv3.x / Math.sqrt(Math.pow(radiusv3.x, 2) + Math.pow(radiusv3.z, 2)));
             this.alpha = Math.acos(radiusv3.x / Math.sqrt(Math.pow(radiusv3.x, 2) + Math.pow(radiusv3.z, 2)));
             if (radiusv3.z < 0) {
             if (radiusv3.z < 0) {

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


+ 4 - 0
src/Cameras/babylon.arcRotateCamera.ts

@@ -466,6 +466,10 @@ module BABYLON {
             var radiusv3 = this.position.subtract(this._getTargetPosition());
             var radiusv3 = this.position.subtract(this._getTargetPosition());
             this.radius = radiusv3.length();
             this.radius = radiusv3.length();
 
 
+            if (this.radius === 0) {
+                this.radius = 0.0001; // Just to avoid division by zero
+            }
+
             // Alpha
             // Alpha
             this.alpha = Math.acos(radiusv3.x / Math.sqrt(Math.pow(radiusv3.x, 2) + Math.pow(radiusv3.z, 2)));
             this.alpha = Math.acos(radiusv3.x / Math.sqrt(Math.pow(radiusv3.x, 2) + Math.pow(radiusv3.z, 2)));