Skip to content

Commit

Permalink
Tweaking the new zoom bounce.
Browse files Browse the repository at this point in the history
  • Loading branch information
emackey committed Jun 22, 2012
1 parent d6b93a2 commit 29940eb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Source/Scene/Camera2DController.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ define([

this._frustum = this._camera.frustum.clone();
this._animationCollection = new AnimationCollection();

this._maxZoomOut = 2.0;
this._frustum.right *= this._maxZoomOut;
this._frustum.left *= this._maxZoomOut;
this._frustum.top *= this._maxZoomOut;
this._frustum.bottom *= this._maxZoomOut;
}

/**
Expand Down Expand Up @@ -222,7 +228,7 @@ define([
var newRight = frustum.right - moveRate;
var newLeft = frustum.left + moveRate;

var maxRight = this._ellipsoid.getRadii().x * Math.PI * 2.0;
var maxRight = this._ellipsoid.getRadii().x * Math.PI * 2.5;
if (newRight > maxRight) {
newRight = maxRight;
newLeft = -newRight;
Expand Down Expand Up @@ -330,8 +336,8 @@ define([
}

if (!translate.isButtonDown() && !rightZoom.isButtonDown() &&
this._camera.frustum.right > this._ellipsoid.getRadii().x * Math.PI &&
!this._lastInertiaZoomMovement && Tween.getAll().length == 0) {
this._camera.frustum.right > this._frustum.right &&
!this._lastInertiaZoomMovement && Tween.getAll().length === 0) {
this._addCorrectFrustumAnimation();
}

Expand Down

1 comment on commit 29940eb

@emackey
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bagnell give this a try.

Please sign in to comment.