Skip to content

Commit

Permalink
Merge branch 'master' into wms-1.3-crs
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcozzi authored Jan 10, 2017
2 parents 7f45c5d + 8ded2a1 commit ab2eb71
Show file tree
Hide file tree
Showing 10 changed files with 165 additions and 349 deletions.
3 changes: 1 addition & 2 deletions Apps/Sandcastle/gallery/CZML.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
viewer.scene.camera.setView({
destination: Cesium.Cartesian3.fromDegrees(-116.52, 35.02, 95000),
orientation: {
heading: 6,
picth: -Cesium.Math.PI_OVER_TWO
heading: 6
}
});
});
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Change Log
* Fixed sky atmosphere from causing incorrect picking and hanging drill picking. [#4783](https://github.com/AnalyticalGraphicsInc/cesium/issues/4783) and [#4784](https://github.com/AnalyticalGraphicsInc/cesium/issues/4784)
* Fixed a bug that could cause a "readyImagery is not actually ready" exception when quickly zooming past the maximum available imagery level of an imagery layer near the poles.
* Fixed a bug that caused all models to use the same highlight color. [#4798] (https://github.com/AnalyticalGraphicsInc/cesium/pull/4798)
* Fixed KML for when color is an empty string [#4826](https://github.com/AnalyticalGraphicsInc/cesium/pull/4826)
* Added support for WMS version 1.3 by using CRS vice SRS query string parameter to request projection. SRS is still used for older versions.

### 1.29 - 2017-01-02
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Josh Becker](https://github.com/JoshuaStorm)
* [Kangning Li](https://github.com/likangning93)
* [Erik Andersson](https://github.com/erikmaarten)
* [Austin Eng](https://github.com/austinEng)
* [NICTA](http://www.nicta.com.au/)
* [Chris Cooper](https://github.com/chris-cooper)
* [Kevin Ring](https://github.com/kring)
Expand Down
194 changes: 50 additions & 144 deletions Source/Core/Cartesian2.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/*global define*/
define([
'./Check',
'./defaultValue',
'./defined',
'./DeveloperError',
'./freezeObject',
'./Math'
], function(
Check,
defaultValue,
defined,
DeveloperError,
Expand Down Expand Up @@ -118,12 +120,8 @@ define([
*/
Cartesian2.pack = function(value, array, startingIndex) {
//>>includeStart('debug', pragmas.debug);
if (!defined(value)) {
throw new DeveloperError('value is required');
}
if (!defined(array)) {
throw new DeveloperError('array is required');
}
Check.typeOf.object(value, 'value');
Check.defined(array, 'array');
//>>includeEnd('debug');

startingIndex = defaultValue(startingIndex, 0);
Expand All @@ -144,9 +142,7 @@ define([
*/
Cartesian2.unpack = function(array, startingIndex, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(array)) {
throw new DeveloperError('array is required');
}
Check.defined(array, 'array');
//>>includeEnd('debug');

startingIndex = defaultValue(startingIndex, 0);
Expand All @@ -168,9 +164,7 @@ define([
*/
Cartesian2.packArray = function(array, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(array)) {
throw new DeveloperError('array is required');
}
Check.defined(array, 'array');
//>>includeEnd('debug');

var length = array.length;
Expand All @@ -195,9 +189,7 @@ define([
*/
Cartesian2.unpackArray = function(array, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(array)) {
throw new DeveloperError('array is required');
}
Check.defined(array, 'array');
//>>includeEnd('debug');

var length = array.length;
Expand Down Expand Up @@ -242,9 +234,7 @@ define([
*/
Cartesian2.maximumComponent = function(cartesian) {
//>>includeStart('debug', pragmas.debug);
if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required');
}
Check.typeOf.object(cartesian, 'cartesian');
//>>includeEnd('debug');

return Math.max(cartesian.x, cartesian.y);
Expand All @@ -258,9 +248,7 @@ define([
*/
Cartesian2.minimumComponent = function(cartesian) {
//>>includeStart('debug', pragmas.debug);
if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required');
}
Check.typeOf.object(cartesian, 'cartesian');
//>>includeEnd('debug');

return Math.min(cartesian.x, cartesian.y);
Expand All @@ -276,15 +264,9 @@ define([
*/
Cartesian2.minimumByComponent = function(first, second, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(first)) {
throw new DeveloperError('first is required.');
}
if (!defined(second)) {
throw new DeveloperError('second is required.');
}
if (!defined(result)) {
throw new DeveloperError('result is required.');
}
Check.typeOf.object(first, 'first');
Check.typeOf.object(second, 'second');
Check.typeOf.object(result, 'result');
//>>includeEnd('debug');


Expand All @@ -304,15 +286,9 @@ define([
*/
Cartesian2.maximumByComponent = function(first, second, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(first)) {
throw new DeveloperError('first is required.');
}
if (!defined(second)) {
throw new DeveloperError('second is required.');
}
if (!defined(result)) {
throw new DeveloperError('result is required.');
}
Check.typeOf.object(first, 'first');
Check.typeOf.object(second, 'second');
Check.typeOf.object(result, 'result');
//>>includeEnd('debug');

result.x = Math.max(first.x, second.x);
Expand All @@ -328,9 +304,7 @@ define([
*/
Cartesian2.magnitudeSquared = function(cartesian) {
//>>includeStart('debug', pragmas.debug);
if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required');
}
Check.typeOf.object(cartesian, 'cartesian');
//>>includeEnd('debug');

return cartesian.x * cartesian.x + cartesian.y * cartesian.y;
Expand Down Expand Up @@ -402,12 +376,8 @@ define([
*/
Cartesian2.normalize = function(cartesian, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
Check.typeOf.object(cartesian, 'cartesian');
Check.typeOf.object(result, 'result');
//>>includeEnd('debug');

var magnitude = Cartesian2.magnitude(cartesian);
Expand All @@ -433,12 +403,8 @@ define([
*/
Cartesian2.dot = function(left, right) {
//>>includeStart('debug', pragmas.debug);
if (!defined(left)) {
throw new DeveloperError('left is required');
}
if (!defined(right)) {
throw new DeveloperError('right is required');
}
Check.typeOf.object(left, 'left');
Check.typeOf.object(right, 'right');
//>>includeEnd('debug');

return left.x * right.x + left.y * right.y;
Expand All @@ -454,15 +420,9 @@ define([
*/
Cartesian2.multiplyComponents = function(left, right, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(left)) {
throw new DeveloperError('left is required');
}
if (!defined(right)) {
throw new DeveloperError('right is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
Check.typeOf.object(left, 'left');
Check.typeOf.object(right, 'right');
Check.typeOf.object(result, 'result');
//>>includeEnd('debug');

result.x = left.x * right.x;
Expand All @@ -480,15 +440,9 @@ define([
*/
Cartesian2.divideComponents = function(left, right, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(left)) {
throw new DeveloperError('left is required');
}
if (!defined(right)) {
throw new DeveloperError('right is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
Check.typeOf.object(left, 'left');
Check.typeOf.object(right, 'right');
Check.typeOf.object(result, 'result');
//>>includeEnd('debug');

result.x = left.x / right.x;
Expand All @@ -506,15 +460,9 @@ define([
*/
Cartesian2.add = function(left, right, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(left)) {
throw new DeveloperError('left is required');
}
if (!defined(right)) {
throw new DeveloperError('right is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
Check.typeOf.object(left, 'left');
Check.typeOf.object(right, 'right');
Check.typeOf.object(result, 'result');
//>>includeEnd('debug');

result.x = left.x + right.x;
Expand All @@ -532,15 +480,9 @@ define([
*/
Cartesian2.subtract = function(left, right, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(left)) {
throw new DeveloperError('left is required');
}
if (!defined(right)) {
throw new DeveloperError('right is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
Check.typeOf.object(left, 'left');
Check.typeOf.object(right, 'right');
Check.typeOf.object(result, 'result');
//>>includeEnd('debug');

result.x = left.x - right.x;
Expand All @@ -558,15 +500,9 @@ define([
*/
Cartesian2.multiplyByScalar = function(cartesian, scalar, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required');
}
if (typeof scalar !== 'number') {
throw new DeveloperError('scalar is required and must be a number.');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
Check.typeOf.object(cartesian, 'cartesian');
Check.typeOf.number(scalar, 'scalar');
Check.typeOf.object(result, 'result');
//>>includeEnd('debug');

result.x = cartesian.x * scalar;
Expand All @@ -584,15 +520,9 @@ define([
*/
Cartesian2.divideByScalar = function(cartesian, scalar, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required');
}
if (typeof scalar !== 'number') {
throw new DeveloperError('scalar is required and must be a number.');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
Check.typeOf.object(cartesian, 'cartesian');
Check.typeOf.number(scalar, 'scalar');
Check.typeOf.object(result, 'result');
//>>includeEnd('debug');

result.x = cartesian.x / scalar;
Expand All @@ -609,12 +539,8 @@ define([
*/
Cartesian2.negate = function(cartesian, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
Check.typeOf.object(cartesian, 'cartesian');
Check.typeOf.object(result, 'result');
//>>includeEnd('debug');

result.x = -cartesian.x;
Expand All @@ -631,12 +557,8 @@ define([
*/
Cartesian2.abs = function(cartesian, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required');
}
if (!defined(result)) {
throw new DeveloperError('result is required');
}
Check.typeOf.object(cartesian, 'cartesian');
Check.typeOf.object(result, 'result');
//>>includeEnd('debug');

result.x = Math.abs(cartesian.x);
Expand All @@ -656,18 +578,10 @@ define([
*/
Cartesian2.lerp = function(start, end, t, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(start)) {
throw new DeveloperError('start is required.');
}
if (!defined(end)) {
throw new DeveloperError('end is required.');
}
if (typeof t !== 'number') {
throw new DeveloperError('t is required and must be a number.');
}
if (!defined(result)) {
throw new DeveloperError('result is required.');
}
Check.typeOf.object(start, 'start');
Check.typeOf.object(end, 'end');
Check.typeOf.number(t, 't');
Check.typeOf.object(result, 'result');
//>>includeEnd('debug');

Cartesian2.multiplyByScalar(end, t, lerpScratch);
Expand All @@ -686,12 +600,8 @@ define([
*/
Cartesian2.angleBetween = function(left, right) {
//>>includeStart('debug', pragmas.debug);
if (!defined(left)) {
throw new DeveloperError('left is required');
}
if (!defined(right)) {
throw new DeveloperError('right is required');
}
Check.typeOf.object(left, 'left');
Check.typeOf.object(right, 'right');
//>>includeEnd('debug');

Cartesian2.normalize(left, angleBetweenScratch);
Expand All @@ -709,12 +619,8 @@ define([
*/
Cartesian2.mostOrthogonalAxis = function(cartesian, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required.');
}
if (!defined(result)) {
throw new DeveloperError('result is required.');
}
Check.typeOf.object(cartesian, 'cartesian');
Check.typeOf.object(result, 'result');
//>>includeEnd('debug');

var f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch);
Expand Down
Loading

0 comments on commit ab2eb71

Please sign in to comment.