Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera space/sky interaction #1954

Merged
merged 10 commits into from
Jul 28, 2014
Next Next commit
Add back rotate when space is clicked. Add look when close to the gro…
…und and the sky is clicked.
  • Loading branch information
bagnell committed Jul 23, 2014
commit 4f69cd4e377c8e84730fbef1a3969bca36544531
17 changes: 15 additions & 2 deletions Source/Scene/ScreenSpaceCameraController.js
Original file line number Diff line number Diff line change
@@ -233,11 +233,18 @@ define([
*/
this.minimumPickingTerrainHeight = 150000.0;
/**
* The minimum height the camera must be before tesing for collision with terrain.
* The minimum height the camera must be before testing for collision with terrain.
* @type {Number}
* @default 10000.0
*/
this.minimumCollisionTerrainHeight = 10000.0;
/**
* The minimum height the camera must be before switching from rotating a track ball to
* free look when clicks originate on the sky on in space.
* @type {Number}
* @default 7500000.0
*/
this.minimumTrackBallHeight = 7500000.0;

this._scene = scene;
this._globe = undefined;
@@ -929,12 +936,18 @@ define([

Cartesian2.clone(startPosition, controller._rotateMousePosition);
Cartesian3.clone(mousePos, controller._rotateStartPosition);
} else {
look3D(controller, startPosition, movement, frameState, true);
}
} else if (defined(camera.pickEllipsoid(movement.startPosition, controller._ellipsoid, spin3DPick))) {
pan3D(controller, startPosition, movement, frameState, controller._ellipsoid);

Cartesian2.clone(startPosition, controller._rotateMousePosition);
Cartesian3.clone(spin3DPick, controller._rotateStartPosition);
} else if (height > controller.minimumTrackBallHeight) {
rotate3D(controller, startPosition, movement, frameState);
} else {
look3D(controller, startPosition, movement, frameState, true);
}
}

@@ -1346,7 +1359,7 @@ define([
var look3DEndPos = new Cartesian2();
var look3DStartRay = new Ray();
var look3DEndRay = new Ray();
function look3D(controller, startPosition, movement, frameState) {
function look3D(controller, startPosition, movement, frameState, useLocalUp) {
var camera = controller._scene.camera;

var startPos = look3DStartPos;