瀏覽代碼

Fixing issue with ArcRotateCamera when beta = 0

David Catuhe 9 年之前
父節點
當前提交
d0e62ba510

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


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


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


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

@@ -12053,6 +12053,9 @@ var BABYLON;
             var sina = Math.sin(this.alpha);
             var cosb = Math.cos(this.beta);
             var sinb = Math.sin(this.beta);
+            if (sinb === 0) {
+                sinb = 0.0001;
+            }
             var target = this._getTargetPosition();
             target.addToRef(new BABYLON.Vector3(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb), this._newPosition);
             if (this.getScene().collisionsEnabled && this.checkCollisions) {

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


+ 3 - 0
src/Cameras/babylon.arcRotateCamera.js

@@ -484,6 +484,9 @@ var BABYLON;
             var sina = Math.sin(this.alpha);
             var cosb = Math.cos(this.beta);
             var sinb = Math.sin(this.beta);
+            if (sinb === 0) {
+                sinb = 0.0001;
+            }
             var target = this._getTargetPosition();
             target.addToRef(new BABYLON.Vector3(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb), this._newPosition);
             if (this.getScene().collisionsEnabled && this.checkCollisions) {

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

@@ -533,6 +533,10 @@
             var cosb = Math.cos(this.beta);
             var sinb = Math.sin(this.beta);
 
+            if (sinb === 0) {
+                sinb = 0.0001;
+            }
+
             var target = this._getTargetPosition();
             target.addToRef(new Vector3(this.radius * cosa * sinb, this.radius * cosb, this.radius * sina * sinb), this._newPosition);
             if (this.getScene().collisionsEnabled && this.checkCollisions) {