Skip to content

Commit

Permalink
Merge pull request #4936 from bampakoa/master
Browse files Browse the repository at this point in the history
Expose DEFAULT_OFFSET from Camera
  • Loading branch information
emackey authored Mar 2, 2017
2 parents abdd545 + a976f25 commit bce5171
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Source/Scene/Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,12 @@ define([
*/
Camera.DEFAULT_VIEW_FACTOR = 0.5;

/**
* The default heading/pitch/range that is used when the camera flies to a location that contains a bounding sphere.
* @type HeadingPitchRange
*/
Camera.DEFAULT_OFFSET = new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_FOUR, 0.0);

function updateViewMatrix(camera) {
Matrix4.computeView(camera._position, camera._direction, camera._up, camera._right, camera._viewMatrix);
Matrix4.multiply(camera._viewMatrix, camera._actualInvTransform, camera._viewMatrix);
Expand Down Expand Up @@ -2690,12 +2696,11 @@ define([
return Math.max(right, top) * 1.50;
}

var scratchDefaultOffset = new HeadingPitchRange(0.0, -CesiumMath.PI_OVER_FOUR, 0.0);
var MINIMUM_ZOOM = 100.0;

function adjustBoundingSphereOffset(camera, boundingSphere, offset) {
if (!defined(offset)) {
offset = HeadingPitchRange.clone(scratchDefaultOffset);
offset = HeadingPitchRange.clone(Camera.DEFAULT_OFFSET);
}

var range = offset.range;
Expand Down

0 comments on commit bce5171

Please sign in to comment.