Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
update : function(value) {
scene.camera.position.x = CesiumMath.lerp(startPosition.x, endPosition.x, value.time);
scene.camera.position.y = CesiumMath.lerp(startPosition.y, endPosition.y, value.time);
scene.camera.position.z = CesiumMath.lerp(startPosition.z, endPosition.z, value.time);
var enuToFixed = Transforms.eastNorthUpToFixedFrame(camera.position, Ellipsoid.WGS84);
var enuToFixedRotation = new Matrix3();
Matrix4.getRotation(enuToFixed, enuToFixedRotation);
camera.up = Matrix3.multiplyByVector(enuToFixedRotation, initialEnuUp, camera.up);
camera.right = Matrix3.multiplyByVector(enuToFixedRotation, initialEnuRight, camera.right);
camera.direction = Matrix3.multiplyByVector(enuToFixedRotation, initialEnuDirection, camera.direction);
},
complete : function() {
var initialEnuToFixed = Transforms.eastNorthUpToFixedFrame(startPosition, Ellipsoid.WGS84);
var initialEnuToFixedRotation = new Matrix4();
Matrix4.getRotation(initialEnuToFixed, initialEnuToFixedRotation);
var initialFixedToEnuRotation = new Matrix3();
Matrix3.transpose(initialEnuToFixedRotation, initialFixedToEnuRotation);
var initialEnuUp = new Matrix3();
Matrix3.multiplyByVector(initialFixedToEnuRotation, camera.up, initialEnuUp);
var initialEnuRight = new Matrix3();
Matrix3.multiplyByVector(initialFixedToEnuRotation, camera.right, initialEnuRight);
var initialEnuDirection = new Matrix3();
Matrix3.multiplyByVector(initialFixedToEnuRotation, camera.direction, initialEnuDirection);
var controller = scene.screenSpaceCameraController;
controller.enableInputs = false;
scene.tweens.add({
duration : durationMilliseconds / 1000.0,
easingFunction : Tween.Easing.Sinusoidal.InOut,
startObject : {
time: 0.0
},
stopObject : {
time : 1.0
},
update : function(value) {
scene.camera.position.x = CesiumMath.lerp(startPosition.x, endPosition.x, value.time);
scene.camera.position.y = CesiumMath.lerp(startPosition.y, endPosition.y, value.time);
durationMilliseconds = defaultValue(durationMilliseconds, 200);
var initialEnuToFixed = Transforms.eastNorthUpToFixedFrame(startPosition, Ellipsoid.WGS84);
var initialEnuToFixedRotation = new Matrix4();
Matrix4.getRotation(initialEnuToFixed, initialEnuToFixedRotation);
var initialFixedToEnuRotation = new Matrix3();
Matrix3.transpose(initialEnuToFixedRotation, initialFixedToEnuRotation);
var initialEnuUp = new Matrix3();
Matrix3.multiplyByVector(initialFixedToEnuRotation, camera.up, initialEnuUp);
var initialEnuRight = new Matrix3();
Matrix3.multiplyByVector(initialFixedToEnuRotation, camera.right, initialEnuRight);
var initialEnuDirection = new Matrix3();
Matrix3.multiplyByVector(initialFixedToEnuRotation, camera.direction, initialEnuDirection);
var controller = scene.screenSpaceCameraController;
controller.enableInputs = false;
scene.tweens.add({
duration : durationMilliseconds / 1000.0,
easingFunction : Tween.Easing.Sinusoidal.InOut,
startObject : {
time: 0.0
},
stopObject : {
time : 1.0
},
var camera = scene.camera;
var startPosition = camera.position;
var endPosition = position;
durationMilliseconds = defaultValue(durationMilliseconds, 200);
var initialEnuToFixed = Transforms.eastNorthUpToFixedFrame(startPosition, Ellipsoid.WGS84);
var initialEnuToFixedRotation = new Matrix4();
Matrix4.getRotation(initialEnuToFixed, initialEnuToFixedRotation);
var initialFixedToEnuRotation = new Matrix3();
Matrix3.transpose(initialEnuToFixedRotation, initialFixedToEnuRotation);
var initialEnuUp = new Matrix3();
Matrix3.multiplyByVector(initialFixedToEnuRotation, camera.up, initialEnuUp);
var initialEnuRight = new Matrix3();
Matrix3.multiplyByVector(initialFixedToEnuRotation, camera.right, initialEnuRight);
var initialEnuDirection = new Matrix3();
Matrix3.multiplyByVector(initialFixedToEnuRotation, camera.direction, initialEnuDirection);
var controller = scene.screenSpaceCameraController;
controller.enableInputs = false;
scene.tweens.add({
duration : durationMilliseconds / 1000.0,
easingFunction : Tween.Easing.Sinusoidal.InOut,
startObject : {
time: 0.0
},
var initialEnuToFixed = Transforms.eastNorthUpToFixedFrame(startPosition, Ellipsoid.WGS84);
var initialEnuToFixedRotation = new Matrix4();
Matrix4.getRotation(initialEnuToFixed, initialEnuToFixedRotation);
var initialFixedToEnuRotation = new Matrix3();
Matrix3.transpose(initialEnuToFixedRotation, initialFixedToEnuRotation);
var initialEnuUp = new Matrix3();
Matrix3.multiplyByVector(initialFixedToEnuRotation, camera.up, initialEnuUp);
var initialEnuRight = new Matrix3();
Matrix3.multiplyByVector(initialFixedToEnuRotation, camera.right, initialEnuRight);
var initialEnuDirection = new Matrix3();
Matrix3.multiplyByVector(initialFixedToEnuRotation, camera.direction, initialEnuDirection);
var controller = scene.screenSpaceCameraController;
controller.enableInputs = false;
scene.tweens.add({
duration : durationMilliseconds / 1000.0,
easingFunction : Tween.Easing.Sinusoidal.InOut,
startObject : {
time: 0.0
},
stopObject : {
time : 1.0
},
update : function(value) {
scene.camera.position.x = CesiumMath.lerp(startPosition.x, endPosition.x, value.time);
scene.camera.position.y = CesiumMath.lerp(startPosition.y, endPosition.y, value.time);
update : function(value) {
scene.camera.position.x = CesiumMath.lerp(startPosition.x, endPosition.x, value.time);
scene.camera.position.y = CesiumMath.lerp(startPosition.y, endPosition.y, value.time);
scene.camera.position.z = CesiumMath.lerp(startPosition.z, endPosition.z, value.time);
var enuToFixed = Transforms.eastNorthUpToFixedFrame(camera.position, Ellipsoid.WGS84);
var enuToFixedRotation = new Matrix3();
Matrix4.getRotation(enuToFixed, enuToFixedRotation);
camera.up = Matrix3.multiplyByVector(enuToFixedRotation, initialEnuUp, camera.up);
camera.right = Matrix3.multiplyByVector(enuToFixedRotation, initialEnuRight, camera.right);
camera.direction = Matrix3.multiplyByVector(enuToFixedRotation, initialEnuDirection, camera.direction);
},
complete : function() {
function offsetFromHeadingPitchRange(heading, pitch, range, result) {
pitch = CesiumMath.clamp(pitch, -CesiumMath.PI_OVER_TWO, CesiumMath.PI_OVER_TWO);
heading = CesiumMath.zeroToTwoPi(heading) - CesiumMath.PI_OVER_TWO;
var pitchQuat = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -pitch, scratchLookAtHeadingPitchRangeQuaternion1);
var headingQuat = Quaternion.fromAxisAngle(Cartesian3.UNIT_Z, -heading, scratchLookAtHeadingPitchRangeQuaternion2);
var rotQuat = Quaternion.multiply(headingQuat, pitchQuat, headingQuat);
var rotMatrix = Matrix3.fromQuaternion(rotQuat, scratchHeadingPitchRangeMatrix3);
var offset = Cartesian3.clone(Cartesian3.UNIT_X, result);
Matrix3.multiplyByVector(rotMatrix, offset, offset);
Cartesian3.negate(offset, offset);
Cartesian3.multiplyByScalar(offset, range, offset);
return offset;
}
update : function(value) {
scene.camera.position.x = CesiumMath.lerp(startPosition.x, endPosition.x, value.time);
scene.camera.position.y = CesiumMath.lerp(startPosition.y, endPosition.y, value.time);
scene.camera.position.z = CesiumMath.lerp(startPosition.z, endPosition.z, value.time);
var enuToFixed = Transforms.eastNorthUpToFixedFrame(camera.position, Ellipsoid.WGS84);
var enuToFixedRotation = new Matrix3();
Matrix4.getRotation(enuToFixed, enuToFixedRotation);
camera.up = Matrix3.multiplyByVector(enuToFixedRotation, initialEnuUp, camera.up);
camera.right = Matrix3.multiplyByVector(enuToFixedRotation, initialEnuRight, camera.right);
camera.direction = Matrix3.multiplyByVector(enuToFixedRotation, initialEnuDirection, camera.direction);
},
complete : function() {