Skip to content

Commit

Permalink
specs
Browse files Browse the repository at this point in the history
  • Loading branch information
hpinkos committed May 16, 2017
1 parent 59fb96e commit 5afc8a3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Change Log
* Fixed bug in conversion formula in `Matrix3.fromHeadingPitchRoll`. [#5195](https://github.com/AnalyticalGraphicsInc/cesium/issues/5195)
* Upgrade FXAA to version 3.11. [#5200](https://github.com/AnalyticalGraphicsInc/cesium/pull/5200)
* `Scene.pickPosition` now caches results per frame to increase performance. [#5117](https://github.com/AnalyticalGraphicsInc/cesium/issues/5117)
* Fixed bug where polylines would not update when `PolylineCollection` model matrix was updated [#5327](https://github.com/AnalyticalGraphicsInc/cesium/pull/5327)

### 1.32 - 2017-04-03

Expand Down
4 changes: 2 additions & 2 deletions Source/Core/PolylinePipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ define([
var inverseModelMatrix = Matrix4.inverseTransformation(modelMatrix, wrapLongitudeInversMatrix);

var origin = Matrix4.multiplyByPoint(inverseModelMatrix, Cartesian3.ZERO, wrapLongitudeOrigin);
var xzNormal = Matrix4.multiplyByPointAsVector(inverseModelMatrix, Cartesian3.UNIT_Y, wrapLongitudeXZNormal);
var xzNormal = Cartesian3.normalize(Matrix4.multiplyByPointAsVector(inverseModelMatrix, Cartesian3.UNIT_Y, wrapLongitudeXZNormal), wrapLongitudeXZNormal);
var xzPlane = Plane.fromPointNormal(origin, xzNormal, wrapLongitudeXZPlane);
var yzNormal = Matrix4.multiplyByPointAsVector(inverseModelMatrix, Cartesian3.UNIT_X, wrapLongitudeYZNormal);
var yzNormal = Cartesian3.normalize(Matrix4.multiplyByPointAsVector(inverseModelMatrix, Cartesian3.UNIT_X, wrapLongitudeYZNormal), wrapLongitudeYZNormal);
var yzPlane = Plane.fromPointNormal(origin, yzNormal, wrapLongitudeYZPlane);

var count = 1;
Expand Down
22 changes: 22 additions & 0 deletions Specs/Scene/PolylineCollectionSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ defineSuite([
'Core/DistanceDisplayCondition',
'Core/HeadingPitchRange',
'Core/Math',
'Core/Matrix4',
'Scene/Camera',
'Scene/Material',
'Scene/SceneMode',
Expand All @@ -19,6 +20,7 @@ defineSuite([
DistanceDisplayCondition,
HeadingPitchRange,
CesiumMath,
Matrix4,
Camera,
Material,
SceneMode,
Expand Down Expand Up @@ -1371,6 +1373,26 @@ defineSuite([

});

it('renders with model matrix', function() {
polylines.add({
positions : [{
x : 0.0,
y : 0.0,
z : 0.0
}, {
x : 0.0,
y : 1.0,
z : 0.0
}]
});

expect(scene).toRender([0, 0, 0, 255]);
scene.primitives.add(polylines);
expect(scene).toRender([0, 0, 0, 255]);
polylines.modelMatrix = Matrix4.fromUniformScale(1000000.0, polylines.modelMatrix);
expect(scene).notToRender([0, 0, 0, 255]);
});

it('is picked', function() {
var p = polylines.add({
positions : [{
Expand Down

0 comments on commit 5afc8a3

Please sign in to comment.