Skip to content
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

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Apps/Sandcastle/gallery/3D Models Coloring.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@
viewer.entities.removeAll();

var position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, height);
var heading = Cesium.Math.toRadians(135);
var heading = -Cesium.Math.toRadians(135);
var pitch = 0;
var roll = 0;
var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr);
var orientation = Cesium.Transforms.directHeadingPitchRollQuaternion(position, hpr);

entity = viewer.entities.add({
name : url,
Expand Down
6 changes: 3 additions & 3 deletions Apps/Sandcastle/gallery/Classification.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

var center = new Cesium.Cartesian3(1216378.730451297, -4736275.917774027, 4081266.871000864);
var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
var hprRotation = Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(2.619728786416368, 0.0, 0.0));
var hprRotation = Cesium.Matrix3.fromDirectHeadingPitchRoll(new Cesium.HeadingPitchRoll(-2.619728786416368, 0.0, 0.0));
var hpr = Cesium.Matrix4.fromRotationTranslation(hprRotation, new Cesium.Cartesian3(0.0, 0.0, -2.0));
Cesium.Matrix4.multiply(modelMatrix, hpr, modelMatrix);

Expand Down Expand Up @@ -91,7 +91,7 @@

var center = new Cesium.Cartesian3(1216398.6054139996, -4736204.533089285, 4081338.6585485404);
var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
var hprRotation = Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(5.785339046755887, 0.0, 0.0));
var hprRotation = Cesium.Matrix3.fromDirectHeadingPitchRoll(new Cesium.HeadingPitchRoll(-5.785339046755887, 0.0, 0.0));
var hpr = Cesium.Matrix4.fromRotationTranslation(hprRotation, new Cesium.Cartesian3(0.4, 0.0, -2.0));
Cesium.Matrix4.multiply(modelMatrix, hpr, modelMatrix);

Expand All @@ -111,7 +111,7 @@

center = new Cesium.Cartesian3(1216394.3346955755, -4736207.431365568, 4081336.7768881875);
modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(center);
hprRotation = Cesium.Matrix3.fromHeadingPitchRoll(new Cesium.HeadingPitchRoll(5.785339046755887, 0.0, 0.0));
hprRotation = Cesium.Matrix3.fromDirectHeadingPitchRoll(new Cesium.HeadingPitchRoll(-5.785339046755887, 0.0, 0.0));
hpr = Cesium.Matrix4.fromRotationTranslation(hprRotation, new Cesium.Cartesian3(-0.25, 0.0, -2.0));
Cesium.Matrix4.multiply(modelMatrix, hpr, modelMatrix);

Expand Down
4 changes: 2 additions & 2 deletions Apps/Sandcastle/gallery/Distance Display Conditions.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@

var position = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 0.0);
var heading = Cesium.Math.toRadians(135);
var hpr = new Cesium.HeadingPitchRoll(heading, 0.0, 0.0);
var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr);
var hpr = new Cesium.HeadingPitchRoll(-heading, 0.0, 0.0);
var orientation = Cesium.Transforms.directHeadingPitchRollQuaternion(position, hpr);

viewer.entities.add({
position : position,
Expand Down
4 changes: 2 additions & 2 deletions Apps/Sandcastle/gallery/HeadingPitchRoll.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ <h1>Loading...</h1>

var planePrimitive = scene.primitives.add(Cesium.Model.fromGltf({
url : '../../SampleData/models/CesiumAir/Cesium_Air.glb',
modelMatrix : Cesium.Transforms.headingPitchRollToFixedFrame(position, hpRoll, Cesium.Ellipsoid.WGS84, fixedFrameTransform),
modelMatrix : Cesium.Transforms.directHeadingPitchRollToFixedFrame(position, hpRoll, Cesium.Ellipsoid.WGS84, fixedFrameTransform),
minimumPixelSize : 128
}));

Expand Down Expand Up @@ -208,7 +208,7 @@ <h1>Loading...</h1>
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);
Copy link
Contributor

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?

Copy link
Contributor Author

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.


if (fromBehind.checked) {
// Zoom to model
Expand Down
6 changes: 3 additions & 3 deletions Apps/Sandcastle/gallery/LocalToFixedFrame.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ <h1>Loading...</h1>
var comments = localFrames[i].comments;
var planePrimitive = scene.primitives.add(Cesium.Model.fromGltf({
url : '../../SampleData/models/CesiumAir/Cesium_Air.glb',
modelMatrix : Cesium.Transforms.headingPitchRollToFixedFrame(position, hpRoll, Cesium.Ellipsoid.WGS84, converter),
modelMatrix : Cesium.Transforms.directHeadingPitchRollToFixedFrame(position, hpRoll, Cesium.Ellipsoid.WGS84, converter),
minimumPixelSize : 128
}));

primitives.push({primitive : planePrimitive, converter : converter, position : position});
var modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame(position, hprRollZero, Cesium.Ellipsoid.WGS84, converter);
var modelMatrix = Cesium.Transforms.directHeadingPitchRollToFixedFrame(position, hprRollZero, Cesium.Ellipsoid.WGS84, converter);
scene.primitives.add(new Cesium.DebugModelMatrixPrimitive({
modelMatrix : modelMatrix,
length : 300.0,
Expand Down Expand Up @@ -221,7 +221,7 @@ <h1>Loading...</h1>
var primitive = primitives[i].primitive;
var converter = primitives[i].converter;
var position = primitives[i].position;
Cesium.Transforms.headingPitchRollToFixedFrame(position, hpRoll, Cesium.Ellipsoid.WGS84, converter, primitive.modelMatrix);
Cesium.Transforms.directHeadingPitchRollToFixedFrame(position, hpRoll, Cesium.Ellipsoid.WGS84, converter, primitive.modelMatrix);
}
});
//Sandcastle_End
Expand Down
4 changes: 2 additions & 2 deletions Apps/Sandcastle/gallery/Projection.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
viewer.projectionPicker.viewModel.switchToOrthographic();

var position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 0.0);
var hpr = new Cesium.HeadingPitchRoll(Cesium.Math.toRadians(135), 0.0, 0.0);
var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, hpr);
var hpr = new Cesium.HeadingPitchRoll(-Cesium.Math.toRadians(135), 0.0, 0.0);
var orientation = Cesium.Transforms.directHeadingPitchRollQuaternion(position, hpr);

var entity = viewer.entities.add({
position : position,
Expand Down
6 changes: 3 additions & 3 deletions Apps/Sandcastle/gallery/development/3D Models.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@

function createModel(url, height, heading, pitch, roll) {
height = Cesium.defaultValue(height, 0.0);
heading = Cesium.defaultValue(heading, 0.0);
pitch = Cesium.defaultValue(pitch, 0.0);
heading = -Cesium.defaultValue(heading, 0.0);
pitch = -Cesium.defaultValue(pitch, 0.0);
roll = Cesium.defaultValue(roll, 0.0);
var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);

var origin = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, height);
var modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame(origin, hpr);
var modelMatrix = Cesium.Transforms.directHeadingPitchRollToFixedFrame(origin, hpr);

scene.primitives.removeAll(); // Remove previous model
model = scene.primitives.add(Cesium.Model.fromGltf({
Expand Down
16 changes: 16 additions & 0 deletions CHANGES.md
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)
Copy link
Contributor

@hpinkos hpinkos Sep 7, 2017

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, who decides?

Copy link
Contributor

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

* `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
Expand Down
35 changes: 33 additions & 2 deletions Source/Core/HeadingPitchRoll.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ define([
'./defaultValue',
'./defined',
'./DeveloperError',
'./Math'
'./Math',
'./deprecationWarning'
], function(
defaultValue,
defined,
DeveloperError,
CesiumMath) {
CesiumMath,
deprecationWarning) {
'use strict';

/**
Expand Down Expand Up @@ -40,6 +42,7 @@ define([
throw new DeveloperError('quaternion is required');
}
//>>includeEnd('debug');
deprecationWarning('HeadingPitchRoll.fromQuaternion', 'This HeadingPitchRoll.fromQuaternion 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 HeadingPitchRoll.fromDirectQuaternion');
if (!defined(result)) {
result = new HeadingPitchRoll();
}
Expand All @@ -54,6 +57,34 @@ define([
return result;
};

/**
* Computes the heading, pitch and roll from a quaternion (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles ) in the mathematical common sense
*
* @param {Quaternion} quaternion The quaternion from which to retrieve heading, pitch, and roll, all expressed in radians.
* @param {HeadingPitchRoll} [result] The object in which to store the result. If not provided, a new instance is created and returned.
* @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
*/
HeadingPitchRoll.fromDirectQuaternion = function(quaternion, result) {
//>>includeStart('debug', pragmas.debug);
if (!defined(quaternion)) {
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.');
Copy link
Contributor

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.

Copy link
Contributor Author

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

if (!defined(result)) {
result = new HeadingPitchRoll();
}
var test = 2 * (quaternion.w * quaternion.y - quaternion.z * quaternion.x);
var denominatorRoll = 1 - 2 * (quaternion.x * quaternion.x + quaternion.y * quaternion.y);
var numeratorRoll = 2 * (quaternion.w * quaternion.x + quaternion.y * quaternion.z);
var denominatorHeading = 1 - 2 * (quaternion.y * quaternion.y + quaternion.z * quaternion.z);
var numeratorHeading = 2 * (quaternion.w * quaternion.z + quaternion.x * quaternion.y);
result.heading = Math.atan2(numeratorHeading, denominatorHeading);
result.roll = Math.atan2(numeratorRoll, denominatorRoll);
result.pitch = Math.asin(test);
return result;
};

/**
* Returns a new HeadingPitchRoll instance from angles given in degrees.
*
Expand Down
56 changes: 54 additions & 2 deletions Source/Core/Matrix3.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ define([
'./defineProperties',
'./DeveloperError',
'./freezeObject',
'./Math'
'./Math',
'./deprecationWarning'
], function(
Cartesian3,
Check,
Expand All @@ -15,7 +16,8 @@ define([
defineProperties,
DeveloperError,
freezeObject,
CesiumMath) {
CesiumMath,
deprecationWarning) {
'use strict';

/**
Expand Down Expand Up @@ -303,6 +305,7 @@ define([
//>>includeStart('debug', pragmas.debug);
Check.typeOf.object('headingPitchRoll', headingPitchRoll);
//>>includeEnd('debug');
deprecationWarning('Matrix3.fromHeadingPitchRoll', 'This Matrix3.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 Matrix3.fromDirectHeadingPitchRoll');

var cosTheta = Math.cos(-headingPitchRoll.pitch);
var cosPsi = Math.cos(-headingPitchRoll.heading);
Expand Down Expand Up @@ -340,6 +343,55 @@ define([
return result;
};

/**
* Computes a 3x3 rotation matrix from the provided headingPitchRoll. (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles ) in the mathematical common sense
*
* @param {HeadingPitchRoll} headingPitchRoll the headingPitchRoll to use.
* @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.
* @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll.
*/
Matrix3.fromDirectHeadingPitchRoll = function(headingPitchRoll, result) {
//>>includeStart('debug', pragmas.debug);
Check.typeOf.object('headingPitchRoll', headingPitchRoll);
//>>includeEnd('debug');
deprecationWarning('Matrix3.fromDirectHeadingPitchRoll', 'This Matrix3.fromDirectHeadingPitchRoll works in the classical interpretation used in mathematics. This function will replaced Matrix3.fromHeadingPitchRoll in 1.43.');

var cosTheta = Math.cos(headingPitchRoll.pitch);
var cosPsi = Math.cos(headingPitchRoll.heading);
var cosPhi = Math.cos(headingPitchRoll.roll);
var sinTheta = Math.sin(headingPitchRoll.pitch);
var sinPsi = Math.sin(headingPitchRoll.heading);
var sinPhi = Math.sin(headingPitchRoll.roll);

var m00 = cosTheta * cosPsi;
var m01 = -cosPhi * sinPsi + sinPhi * sinTheta * cosPsi;
var m02 = sinPhi * sinPsi + cosPhi * sinTheta * cosPsi;

var m10 = cosTheta * sinPsi;
var m11 = cosPhi * cosPsi + sinPhi * sinTheta * sinPsi;
var m12 = -sinPhi * cosPsi + cosPhi * sinTheta * sinPsi;

var m20 = -sinTheta;
var m21 = sinPhi * cosTheta;
var m22 = cosPhi * cosTheta;

if (!defined(result)) {
return new Matrix3(m00, m01, m02,
m10, m11, m12,
m20, m21, m22);
}
result[0] = m00;
result[1] = m10;
result[2] = m20;
result[3] = m01;
result[4] = m11;
result[5] = m21;
result[6] = m02;
result[7] = m12;
result[8] = m22;
return result;
};

/**
* Computes a Matrix3 instance representing a non-uniform scale.
*
Expand Down
29 changes: 27 additions & 2 deletions Source/Core/Quaternion.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ define([
'./freezeObject',
'./HeadingPitchRoll',
'./Math',
'./Matrix3'
'./Matrix3',
'./deprecationWarning'
], function(
Cartesian3,
Check,
Expand All @@ -17,7 +18,8 @@ define([
freezeObject,
HeadingPitchRoll,
CesiumMath,
Matrix3) {
Matrix3,
deprecationWarning) {
'use strict';

/**
Expand Down Expand Up @@ -188,6 +190,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);
Expand All @@ -196,6 +199,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.
*
* @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');
deprecationWarning('Quaternion.fromDirectHeadingPitchRoll', 'This Quaternion.fromDirectHeadingPitchRoll works in the classical interpretation used in mathematics. This function will replaced Quaternion.fromHeadingPitchRoll in 1.43.');

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();
Expand Down
Loading