diff --git a/CHANGES.md b/CHANGES.md index 169804a9751f..1c038dc5ea5e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,10 @@ Change Log ### 1.36 - 2017-08-01 +* Breaking changes + * The function `Quaternion.fromHeadingPitchRoll(heading, pitch, roll, result)` was removed. Use `Quaternion.fromHeadingPitchRoll(hpr, result)` instead where `hpr` is a `HeadingPitchRoll`. + * The function `Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)` was removed. Use `Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result)` instead where `fixedFrameTransform` is a a 4x4 transformation matrix (see `Transforms.localFrameToFixedFrameGenerator`). + * The function `Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)` was removed. Use `Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result)` instead where `fixedFrameTransform` is a a 4x4 transformation matrix (see `Transforms.localFrameToFixedFrameGenerator`). * Added ability to show tile urls in the 3D Tiles Inspector. [#5592](https://github.com/AnalyticalGraphicsInc/cesium/pull/5592) * Added behavior to `Cesium3DTilesInspector` that selects the first tileset hovered over if no tilest is specified. [#5139](https://github.com/AnalyticalGraphicsInc/cesium/issues/5139) * Added ability to provide a `width` and `height` to `scene.pick`. [#5602](https://github.com/AnalyticalGraphicsInc/cesium/pull/5602) diff --git a/Source/Core/Quaternion.js b/Source/Core/Quaternion.js index b021504e1d36..346c135d71d9 100644 --- a/Source/Core/Quaternion.js +++ b/Source/Core/Quaternion.js @@ -3,7 +3,6 @@ define([ './Check', './defaultValue', './defined', - './deprecationWarning', './FeatureDetection', './freezeObject', './HeadingPitchRoll', @@ -14,7 +13,6 @@ define([ Check, defaultValue, defined, - deprecationWarning, FeatureDetection, freezeObject, HeadingPitchRoll, @@ -186,28 +184,15 @@ define([ * @param {Quaternion} [result] The object onto which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. */ - Quaternion.fromHeadingPitchRoll = function(headingOrHeadingPitchRoll, pitchOrResult, roll, result) { + Quaternion.fromHeadingPitchRoll = function(headingPitchRoll, result) { //>>includeStart('debug', pragmas.debug); - if (headingOrHeadingPitchRoll instanceof HeadingPitchRoll) { - Check.typeOf.object('headingPitchRoll', headingOrHeadingPitchRoll); - } else { - Check.typeOf.number('heading', headingOrHeadingPitchRoll); - Check.typeOf.number('pitch', pitchOrResult); - Check.typeOf.number('roll', roll); - } + Check.typeOf.object('headingPitchRoll', headingPitchRoll); //>>includeEnd('debug'); - var hpr; - if (headingOrHeadingPitchRoll instanceof HeadingPitchRoll) { - hpr = headingOrHeadingPitchRoll; - result = pitchOrResult; - } else { - deprecationWarning('Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)', 'The method was deprecated in Cesium 1.32 and will be removed in version 1.33. ' + 'Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll'); - hpr = new HeadingPitchRoll(headingOrHeadingPitchRoll, pitchOrResult, roll); - } - scratchRollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, hpr.roll, scratchHPRQuaternion); - scratchPitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -hpr.pitch, result); + + scratchRollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, headingPitchRoll.roll, scratchHPRQuaternion); + scratchPitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -headingPitchRoll.pitch, result); result = Quaternion.multiply(scratchPitchQuaternion, scratchRollQuaternion, scratchPitchQuaternion); - scratchHeadingQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Z, -hpr.heading, scratchHPRQuaternion); + scratchHeadingQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Z, -headingPitchRoll.heading, scratchHPRQuaternion); return Quaternion.multiply(scratchHeadingQuaternion, result, result); }; diff --git a/Source/Core/Transforms.js b/Source/Core/Transforms.js index 8e097ca48789..ef3ce08a0cbe 100644 --- a/Source/Core/Transforms.js +++ b/Source/Core/Transforms.js @@ -7,7 +7,6 @@ define([ './Check', './defaultValue', './defined', - './deprecationWarning', './DeveloperError', './EarthOrientationParameters', './EarthOrientationParametersSample', @@ -29,7 +28,6 @@ define([ Check, defaultValue, defined, - deprecationWarning, DeveloperError, EarthOrientationParameters, EarthOrientationParametersSample, @@ -317,7 +315,7 @@ define([ * @param {Cartesian3} origin The center point of the local reference frame. * @param {HeadingPitchRoll} headingPitchRoll The heading, pitch, and roll. * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation. - * @param {Transforms~LocalFrameToFixedFrame} [fixedFrameTransformOrResult=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation + * @param {Transforms~LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation * matrix from a reference frame to the provided ellipsoid's fixed reference frame * @param {Matrix4} [result] The object onto which to store the result. * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided. @@ -331,21 +329,15 @@ define([ * var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll); * var transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr); */ - Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, fixedFrameTransformOrResult, result) { + Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object( 'HeadingPitchRoll', headingPitchRoll); //>>includeEnd('debug'); - // checks for required parameters happen in the called functions - if(fixedFrameTransformOrResult instanceof Matrix4){ - result = fixedFrameTransformOrResult; - fixedFrameTransformOrResult = undefined; - deprecationWarning('Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)', 'The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)'); - } - fixedFrameTransformOrResult = defaultValue(fixedFrameTransformOrResult,Transforms.eastNorthUpToFixedFrame); + fixedFrameTransform = defaultValue(fixedFrameTransform, Transforms.eastNorthUpToFixedFrame); var hprQuaternion = Quaternion.fromHeadingPitchRoll(headingPitchRoll, scratchHPRQuaternion); var hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(Cartesian3.ZERO, hprQuaternion, scratchScale, scratchHPRMatrix4); - result = fixedFrameTransformOrResult(origin, ellipsoid, result); + result = fixedFrameTransform(origin, ellipsoid, result); return Matrix4.multiply(result, hprMatrix, result); }; @@ -361,7 +353,7 @@ define([ * @param {Cartesian3} origin The center point of the local reference frame. * @param {HeadingPitchRoll} headingPitchRoll The heading, pitch, and roll. * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation. - * @param {Transforms~LocalFrameToFixedFrame} [fixedFrameTransformOrResult=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation + * @param {Transforms~LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation * matrix from a reference frame to the provided ellipsoid's fixed reference frame * @param {Quaternion} [result] The object onto which to store the result. * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided. @@ -375,16 +367,12 @@ define([ * var hpr = new HeadingPitchRoll(heading, pitch, roll); * var quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr); */ - Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, fixedFrameTransformOrResult, result) { + Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) { //>>includeStart('debug', pragmas.debug); Check.typeOf.object( 'HeadingPitchRoll', headingPitchRoll); //>>includeEnd('debug'); - if (fixedFrameTransformOrResult instanceof Quaternion) { - result = fixedFrameTransformOrResult; - fixedFrameTransformOrResult = undefined; - deprecationWarning('Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)', 'The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)'); - } - var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid,fixedFrameTransformOrResult, scratchENUMatrix4); + + var transform = Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, scratchENUMatrix4); var rotation = Matrix4.getRotation(transform, scratchHPRMatrix3); return Quaternion.fromRotationMatrix(rotation, result); }; diff --git a/Specs/Core/QuaternionSpec.js b/Specs/Core/QuaternionSpec.js index ca68320c9ace..c969f95f690c 100644 --- a/Specs/Core/QuaternionSpec.js +++ b/Specs/Core/QuaternionSpec.js @@ -157,16 +157,6 @@ defineSuite([ expect(quaternion).toEqualEpsilon(expected, CesiumMath.EPSILON11); }); - it('fromHeadingPitchRoll works with individual angle parameters', function() { - var heading = CesiumMath.toRadians(180.0); - var pitch = CesiumMath.toRadians(-45.0); - var roll = CesiumMath.toRadians(45.0); - var hpr = new HeadingPitchRoll( heading, pitch, roll); - var quaternion1 = Quaternion.fromHeadingPitchRoll(hpr); - var quaternion2 = Quaternion.fromHeadingPitchRoll(heading, pitch, roll); - expect(quaternion1).toEqual(quaternion2); - }); - it('clone without a result parameter', function() { var quaternion = new Quaternion(1.0, 2.0, 3.0, 4.0); var result = quaternion.clone();