|
@@ -344,9 +344,24 @@ var BABYLON = BABYLON || {};
|
|
|
|
|
|
// Inertia
|
|
|
if (needToMove) {
|
|
|
+ if (Math.abs(this.cameraDirection.x) < BABYLON.Engine.epsilon)
|
|
|
+ this.cameraDirection.x = 0;
|
|
|
+
|
|
|
+ if (Math.abs(this.cameraDirection.y) < BABYLON.Engine.epsilon)
|
|
|
+ this.cameraDirection.y = 0;
|
|
|
+
|
|
|
+ if (Math.abs(this.cameraDirection.z) < BABYLON.Engine.epsilon)
|
|
|
+ this.cameraDirection.z = 0;
|
|
|
+
|
|
|
this.cameraDirection.scaleInPlace(this.inertia);
|
|
|
}
|
|
|
if (needToRotate) {
|
|
|
+ if (Math.abs(this.cameraRotation.x) < BABYLON.Engine.epsilon)
|
|
|
+ this.cameraRotation.x = 0;
|
|
|
+
|
|
|
+ if (Math.abs(this.cameraRotation.y) < BABYLON.Engine.epsilon)
|
|
|
+ this.cameraRotation.y = 0;
|
|
|
+
|
|
|
this.cameraRotation.scaleInPlace(this.inertia);
|
|
|
}
|
|
|
};
|