-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
make Heading pitch roll counter clock wise again 2 #5809
Changes from 10 commits
b12bf9d
fced5d3
66e6da1
a02d32c
a8234af
9135155
f1c1337
0223afc
6281116
02f4046
7468635
db16f8f
fc9cb93
16cd536
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
Change Log | ||
========== | ||
### 1.38 - 2017-10-01 | ||
|
||
* Breaking changes | ||
|
||
* Deprecated | ||
* `HeadingPitchRoll.fromDirectQuaternion` is deprecated and his behaviour will replace `HeadingPitchRoll.fromQuaternion` behaviour in 1.43. [#5666](https://github.com/AnalyticalGraphicsInc/cesium/issues/5666) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to deprecate this 6 months out? We normally do 1-3 releases. I think 3 releases would be appropriate for this case unless someone said otherwise. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, who decides? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kaktus40 usually the developer and whoever reviews decides. I agree with @hpinkos that 3 releases would be fine. Please submit a GitHub issue for the deprecation. For more on deprecation, see https://github.com/AnalyticalGraphicsInc/cesium/tree/master/Documentation/Contributors/CodingGuide#deprecation-and-breaking-changes |
||
* `Matrix3.fromDirectHeadingPitchRoll` is deprecated and his behaviour will replace `Matrix3.fromHeadingPitchRoll` behaviour in 1.43. [#5666](https://github.com/AnalyticalGraphicsInc/cesium/issues/5666) | ||
* `Quaternion.fromDirectHeadingPitchRoll` is deprecated and his behaviour will replace `Quaternion.fromHeadingPitchRoll` behaviour in 1.43. [#5666](https://github.com/AnalyticalGraphicsInc/cesium/issues/5666) | ||
* `Transforms.directHeadingPitchRollToFixedFrame` is deprecated and his behaviour will replace `Transforms.headingPitchRollToFixedFrame` behaviour in 1.43. [#5666](https://github.com/AnalyticalGraphicsInc/cesium/issues/5666) | ||
* `Transforms.directHeadingPitchRollQuaternion` is deprecated and his behaviour will replace `Transforms.headingPitchRollQuaternion` behaviour in 1.43. [#5666](https://github.com/AnalyticalGraphicsInc/cesium/issues/5666) | ||
* Added HeadingPitchRoll.fromDirectQuaternion that works with classical orientation of heading and pitch [#5666](https://github.com/AnalyticalGraphicsInc/cesium/issues/5666) | ||
* Added Matrix3.fromDirectHeadingPitchRoll that works with classical orientation of heading and pitch [#5666](https://github.com/AnalyticalGraphicsInc/cesium/issues/5666) | ||
* Added Quaternion.fromDirectHeadingPitchRoll that works with classical orientation of heading and pitch [#5666](https://github.com/AnalyticalGraphicsInc/cesium/issues/5666) | ||
* Added Transforms.directHeadingPitchRollToFixedFrame that works with classical orientation of heading and pitch [#5666](https://github.com/AnalyticalGraphicsInc/cesium/issues/5666) | ||
* Added Transforms.directHeadingPitchRollQuaternion that works with classical orientation of heading and pitch [#5666](https://github.com/AnalyticalGraphicsInc/cesium/issues/5666) | ||
|
||
### 1.37 - 2017-09-01 | ||
|
||
* Breaking changes | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,8 @@ define([ | |
'./freezeObject', | ||
'./HeadingPitchRoll', | ||
'./Math', | ||
'./Matrix3' | ||
'./Matrix3', | ||
'./deprecationWarning' | ||
], function( | ||
Cartesian3, | ||
Check, | ||
|
@@ -17,7 +18,8 @@ define([ | |
freezeObject, | ||
HeadingPitchRoll, | ||
CesiumMath, | ||
Matrix3) { | ||
Matrix3, | ||
deprecationWarning) { | ||
'use strict'; | ||
|
||
/** | ||
|
@@ -179,6 +181,7 @@ define([ | |
* Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the | ||
* negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about | ||
* the positive x axis. | ||
* @deprecated since V1.38 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the "since V1.38" show up in the doc? We usually just put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tested and it shows up in the doc. I found this syntax here |
||
* | ||
* @param {HeadingPitchRoll} headingPitchRoll The rotation expressed as a heading, pitch and roll. | ||
* @param {Quaternion} [result] The object onto which to store the result. | ||
|
@@ -188,6 +191,7 @@ define([ | |
//>>includeStart('debug', pragmas.debug); | ||
Check.typeOf.object('headingPitchRoll', headingPitchRoll); | ||
//>>includeEnd('debug'); | ||
deprecationWarning('Quaternion.fromHeadingPitchRoll', 'This Quaternion.fromHeadingPitchRoll works in the Cesium legacy fashion which means that heading and pitch is opposite of the classical interpretation used in mathematics. This behavior will be corrected in 1.43 in order to be classical. The new behavior can be evaluate with Quaternion.fromDirectHeadingPitchRoll'); | ||
|
||
scratchRollQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_X, headingPitchRoll.roll, scratchHPRQuaternion); | ||
scratchPitchQuaternion = Quaternion.fromAxisAngle(Cartesian3.UNIT_Y, -headingPitchRoll.pitch, result); | ||
|
@@ -196,6 +200,28 @@ define([ | |
return Quaternion.multiply(scratchHeadingQuaternion, result, result); | ||
}; | ||
|
||
/** | ||
* Computes a rotation from the given heading, pitch and roll angles in the mathematical common sense. Heading is the rotation about the | ||
* negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about | ||
* the positive x axis. | ||
* This Quaternion.fromDirectHeadingPitchRoll works in the classical interpretation used in mathematics. This function will replaced Quaternion.fromHeadingPitchRoll in 1.43. | ||
* | ||
* @param {HeadingPitchRoll} headingPitchRoll The rotation expressed as a heading, pitch and roll. | ||
* @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.fromDirectHeadingPitchRoll = function(headingPitchRoll, result) { | ||
//>>includeStart('debug', pragmas.debug); | ||
Check.typeOf.object('headingPitchRoll', headingPitchRoll); | ||
//>>includeEnd('debug'); | ||
|
||
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, headingPitchRoll.heading, scratchHPRQuaternion); | ||
return Quaternion.multiply(scratchHeadingQuaternion, result, result); | ||
}; | ||
|
||
var sampledQuaternionAxis = new Cartesian3(); | ||
var sampledQuaternionRotation = new Cartesian3(); | ||
var sampledQuaternionTempQuaternion = new Quaternion(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For
directHeadingPitchRollToFixedFrane
, do we need to modify the parameters for these two functions at all like you are doing everywhere else you're using the new functions?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
directHeadingPitchRollToFixedFrame
takes the same parameters thanheadingPitchRollToFixedFrame
. Internally, it usesQuaternion.fromDirectHeadingPitchRoll
instead ofQuaternion.fromHeadingPitchRoll
. For now in this PR we have two groups of functions that we shouldn't mix. The first group, that should be deprecated, has the next functions:HeadingPitchRoll.fromQuaternion
,Matrix3.fromHeadingPitchRoll
,Quaternion.fromHeadingPitchRoll
,Transforms.HeadingPitchRollToFixedFrame
.The newcomer group, that should replace the first group, has the next functions:
HeadingPitchRoll.fromDirectQuaternion
,Matrix3.fromDirectHeadingPitchRoll
,Quaternion.fromDirectHeadingPitchRoll
,Transforms.directHeadingPitchRollToFixedFrame
.A function in the first group and its equivalent in the second group takes the same parameters in the same orders and return the same type of result (HeadingPitchRoll, Matrix3, Quaternion or Matrix4 instances respectively). The only difference is the sense of rotation for heading and pitch used internally.
Normally, I checked in my IDE that each instance of the first group functions and if needed, I changed for the equivalent in the second group. Also I didn't replace the functions when the parameters where heading=0, pitch=0 because there will be no change in their behaviour.