-
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
Conversation
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.
Thanks @kaktus40! I have a few comments.
@@ -208,7 +208,7 @@ | |||
speedVector = Cesium.Cartesian3.multiplyByScalar(Cesium.Cartesian3.UNIT_X, speed / 10, speedVector); | |||
position = Cesium.Matrix4.multiplyByPoint(planePrimitive.modelMatrix, speedVector, position); | |||
pathPosition.addSample(Cesium.JulianDate.now(), position); | |||
Cesium.Transforms.headingPitchRollToFixedFrame(position, hpRoll, Cesium.Ellipsoid.WGS84, fixedFrameTransform, planePrimitive.modelMatrix); | |||
Cesium.Transforms.directHeadingPitchRollToFixedFrame(position, hpRoll, Cesium.Ellipsoid.WGS84, fixedFrameTransform, planePrimitive.modelMatrix); |
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 than headingPitchRollToFixedFrame
. Internally, it uses Quaternion.fromDirectHeadingPitchRoll
instead of Quaternion.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.
Source/Core/HeadingPitchRoll.js
Outdated
throw new DeveloperError('quaternion is required'); | ||
} | ||
//>>includeEnd('debug'); | ||
deprecationWarning('HeadingPitchRoll.fromDirectQuaternion', 'This HeadingPitchRoll.fromDirectQuaternion works in the classical interpretation used in mathematics. This function will replaced HeadingPitchRoll.fromQuaternion in 1.43.'); |
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.
You shouldn't include the deprecation warning in the new functions. Instead include this additional information about how it's been calculated in the documentation.
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.
I just updated following your recommandations
Alright, thanks @kaktus40! This looks good to me. Make sure before we merge this you submit issues to remove the depreciated function in future versions as we specify in the Coding Guide in the Deprecation section @pjcozzi Does this look good to merge? |
CHANGES.md
Outdated
* 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 comment
The 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 comment
The 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 comment
The 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
Source/Core/Quaternion.js
Outdated
@@ -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 comment
The 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 @deprecated
.
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.
I tested and it shows up in the doc. I found this syntax here
Specs/Core/HeadingPitchRollSpec.js
Outdated
it('conversion from direct quaternion', function() { | ||
var testingTab = [ | ||
[0, 0, 0], | ||
[90 * deg2rad, 0, 0], |
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.
Maybe this file was already like this, but why not use the conversion functions in Cesium.Math
?
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.
In the old PR, I used this variable, which is also a shortcut to CesiumMath.RADIANS_PER_DEGREE, for its concision.
It's a shame that we have to deprecate the most natural name for these functions, what is the meaning of "direct?" Is that the best possible name? Are there any other options that would preserve the current name, e.g., with the addition of a parameter? |
Well for the name of direct, it's a hint about direct orthonormed repere. I didn't find an elegant solution to maintain the current name because after deprecation, the additional parameter will be removed. For the user who decide to update his code, he'll need to change a second time. |
Sorry I'm dense here, but what does this mean? "direct orthonormal representation?" Can you point me to a use of this term with "direct" in some literature? |
Well you are right, that's a bad translation... So would you like that I rename the functions with a prefix like trigonometricWise or any suggestion? Or should I use the same functions with a new parameter (a boolean). With the first solution the user will just need to rename the static functions when the change will be needed. The second solutions seems more difficult to update.
|
I change the deprecated version from 1.43 to 1.40
|
Thanks @kaktus40. I think adding and optional boolean parameter might keep the naming more clear. Could you also make your updates to CHANGES.md shorter with maybe one or two bullet points describing the changes? |
I'll need some suggestions to sum up my writings in the CHANGES.md. |
If we're going with passing the parameter, I think this will be enough:
|
That's good for me. So @pjcozzi is it ok to add a boolean parameter or an other solution? |
@kaktus40 thanks for the updates. I'll take a quick look this week. |
I push the update where I add a boolean parameter into original functions. |
@kaktus40 thanks again for the updates! Given all the Let's sit on this idea for a few days to see if anyone has any objections. |
Hello, so what should I do? |
@kaktus40 I think @pjcozzi 's plan here to remove the Thanks for your patience, these changes will have a pretty big impact, so we want to make sure we taking the best path forward! |
Given no objections to #5809 (comment), I think it is OK to make this change now. @kaktus40 do you want to do it or do you want one of the maintainers to do it? |
Sorry I can't work on it the next week. Nom objection if a maintainer works on it.
|
@ggetz do you have time to do this before the next release? |
following this and that