Skip to content
Browse files

Prevent tilting in wrong direction.

  • Loading branch information...
1 parent b7ff202 commit c3459b5c32f813bd9abebc0de055b717ab7496fd @bagnell bagnell committed Oct 1, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 Source/Scene/CameraCentralBodyController.js
View
5 Source/Scene/CameraCentralBodyController.js
@@ -125,7 +125,10 @@ define([
camera.right = Cartesian3.fromCartesian4(invTransform.multiplyByVector(new Cartesian4(right.x, right.y, right.z, 0.0)));
camera.direction = Cartesian3.fromCartesian4(invTransform.multiplyByVector(new Cartesian4(direction.x, direction.y, direction.z, 0.0)));
- this.spindleController._rotate(movement);
+ var yDiff = movement.startPosition.y - movement.endPosition.y;
+ if (!camera.position.normalize().equalsEpsilon(Cartesian3.UNIT_Z, CesiumMath.EPSILON2) || yDiff > 0) {
+ this.spindleController._rotate(movement);
+ }
position = camera.position;
up = camera.up;

0 comments on commit c3459b5

Please sign in to comment.
Something went wrong with that request. Please try again.