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

Expose DEFAULT_OFFSET from Camera #4936

Merged
merged 1 commit into from
Mar 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Source/Scene/Camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,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 @@ -2685,12 +2691,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