Skip to content

Commit

Permalink
Merge pull request #4852 from shehzan10/master-to-3d-tiles-test-fixes
Browse files Browse the repository at this point in the history
Fixes to tests caused by breaking API change in Transform heading pitch roll
  • Loading branch information
pjcozzi authored Jan 11, 2017
2 parents 4fd5e6c + e02d90c commit 81fce74
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
5 changes: 4 additions & 1 deletion Specs/Scene/Batched3DModel3DTileContentSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ defineSuite([
'Core/Cartesian3',
'Core/deprecationWarning',
'Core/HeadingPitchRange',
'Core/HeadingPitchRoll',
'Core/Transforms',
'Specs/Cesium3DTilesTester',
'Specs/createScene'
Expand All @@ -12,6 +13,7 @@ defineSuite([
Cartesian3,
deprecationWarning,
HeadingPitchRange,
HeadingPitchRoll,
Transforms,
Cesium3DTilesTester,
createScene) {
Expand Down Expand Up @@ -169,7 +171,8 @@ defineSuite([
var newLongitude = -1.31962;
var newLatitude = 0.698874;
var newCenter = Cartesian3.fromRadians(newLongitude, newLatitude, 0.0);
var newTransform = Transforms.headingPitchRollToFixedFrame(newCenter, 0.0, 0.0, 0.0);
var newHPR = new HeadingPitchRoll();
var newTransform = Transforms.headingPitchRollToFixedFrame(newCenter, newHPR);

// Update tile transform
tileset._root.transform = newTransform;
Expand Down
5 changes: 4 additions & 1 deletion Specs/Scene/Cesium3DTileSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ defineSuite([
'Core/Cartesian3',
'Core/clone',
'Core/defined',
'Core/HeadingPitchRoll',
'Core/Math',
'Core/Matrix3',
'Core/Matrix4',
Expand All @@ -18,6 +19,7 @@ defineSuite([
Cartesian3,
clone,
defined,
HeadingPitchRoll,
CesiumMath,
Matrix3,
Matrix4,
Expand Down Expand Up @@ -136,7 +138,8 @@ defineSuite([

function getTileTransform(longitude, latitude) {
var transformCenter = Cartesian3.fromRadians(longitude, latitude, 0.0);
var transformMatrix = Transforms.headingPitchRollToFixedFrame(transformCenter, 0.0, 0.0, 0.0);
var hpr = new HeadingPitchRoll();
var transformMatrix = Transforms.headingPitchRollToFixedFrame(transformCenter, hpr);
return Matrix4.pack(transformMatrix, new Array(16));
}

Expand Down
4 changes: 2 additions & 2 deletions Specs/Scene/EllipsoidPrimitiveSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ defineSuite([
var e = new EllipsoidPrimitive({
center : new Cartesian3(1.0, 2.0, 3.0),
radii : new Cartesian3(4.0, 5.0, 6.0),
modelMatrix : Matrix4.fromScale(2.0),
modelMatrix : Matrix4.fromUniformScale(2.0),
show : false,
material : material,
id : 'id',
Expand All @@ -64,7 +64,7 @@ defineSuite([

expect(e.center).toEqual(new Cartesian3(1.0, 2.0, 3.0));
expect(e.radii).toEqual(new Cartesian3(4.0, 5.0, 6.0));
expect(e.modelMatrix).toEqual(Matrix4.fromScale(2.0));
expect(e.modelMatrix).toEqual(Matrix4.fromUniformScale(2.0));
expect(e.show).toEqual(false);
expect(e.material).toBe(material);
expect(e.id).toEqual('id');
Expand Down
5 changes: 4 additions & 1 deletion Specs/Scene/Instanced3DModel3DTileContentSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ defineSuite([
'Scene/Instanced3DModel3DTileContent',
'Core/Cartesian3',
'Core/HeadingPitchRange',
'Core/HeadingPitchRoll',
'Core/Transforms',
'Scene/Cesium3DTileContentState',
'Scene/TileBoundingSphere',
Expand All @@ -12,6 +13,7 @@ defineSuite([
Instanced3DModel3DTileContent,
Cartesian3,
HeadingPitchRange,
HeadingPitchRoll,
Transforms,
Cesium3DTileContentState,
TileBoundingSphere,
Expand Down Expand Up @@ -198,7 +200,8 @@ defineSuite([
var newLongitude = -1.31962;
var newLatitude = 0.698874;
var newCenter = Cartesian3.fromRadians(newLongitude, newLatitude, 15.0);
var newTransform = Transforms.headingPitchRollToFixedFrame(newCenter, 0.0, 0.0, 0.0);
var newHPR = new HeadingPitchRoll();
var newTransform = Transforms.headingPitchRollToFixedFrame(newCenter, newHPR);

// Update tile transform
tileset._root.transform = newTransform;
Expand Down
5 changes: 4 additions & 1 deletion Specs/Scene/ModelInstanceCollectionSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ defineSuite([
'Core/defaultValue',
'Core/defined',
'Core/HeadingPitchRange',
'Core/HeadingPitchRoll',
'Core/JulianDate',
'Core/Math',
'Core/Matrix4',
Expand All @@ -25,6 +26,7 @@ defineSuite([
defaultValue,
defined,
HeadingPitchRange,
HeadingPitchRoll,
JulianDate,
CesiumMath,
Matrix4,
Expand Down Expand Up @@ -127,7 +129,8 @@ defineSuite([
var heading = Math.PI/2.0;
var pitch = 0.0;
var roll = 0.0;
var modelMatrix = Transforms.headingPitchRollToFixedFrame(position, heading, pitch, roll);
var hpr = new HeadingPitchRoll(heading, pitch, roll);
var modelMatrix = Transforms.headingPitchRollToFixedFrame(position, hpr);
instances.push({
modelMatrix : modelMatrix
});
Expand Down
5 changes: 4 additions & 1 deletion Specs/Scene/PointCloud3DTileContentSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ defineSuite([
'Core/ComponentDatatype',
'Core/defined',
'Core/HeadingPitchRange',
'Core/HeadingPitchRoll',
'Core/Transforms',
'Scene/Cesium3DTileStyle',
'Scene/Expression',
Expand All @@ -18,6 +19,7 @@ defineSuite([
ComponentDatatype,
defined,
HeadingPitchRange,
HeadingPitchRoll,
Transforms,
Cesium3DTileStyle,
Expression,
Expand Down Expand Up @@ -233,7 +235,8 @@ defineSuite([
var newLongitude = -1.31962;
var newLatitude = 0.698874;
var newCenter = Cartesian3.fromRadians(newLongitude, newLatitude, 5.0);
var newTransform = Transforms.headingPitchRollToFixedFrame(newCenter, 0.0, 0.0, 0.0);
var newHPR = new HeadingPitchRoll();
var newTransform = Transforms.headingPitchRollToFixedFrame(newCenter, newHPR);

// Update tile transform
tileset._root.transform = newTransform;
Expand Down

0 comments on commit 81fce74

Please sign in to comment.