Bläddra i källkod

Merge pull request #1554 from abow/master

fix for arcRotateCamera when beta is near 0
David Catuhe 8 år sedan
förälder
incheckning
91ee9b8a25
1 ändrade filer med 3 tillägg och 2 borttagningar
  1. 3 2
      src/Cameras/babylon.arcRotateCamera.ts

+ 3 - 2
src/Cameras/babylon.arcRotateCamera.ts

@@ -288,14 +288,15 @@
             this.inputs.checkInputs();
             // Inertia
             if (this.inertialAlphaOffset !== 0 || this.inertialBetaOffset !== 0 || this.inertialRadiusOffset !== 0) {
-                this.beta += this.inertialBetaOffset;                    
-
+                
                 if (this.getScene().useRightHandedSystem) {
                     this.alpha -= this.beta <= 0 ? -this.inertialAlphaOffset : this.inertialAlphaOffset;
                 } else {
                     this.alpha += this.beta <= 0 ? -this.inertialAlphaOffset : this.inertialAlphaOffset;
                 }
 
+                this.beta += this.inertialBetaOffset;
+
                 this.radius -= this.inertialRadiusOffset;
                 this.inertialAlphaOffset *= this.inertia;
                 this.inertialBetaOffset *= this.inertia;