Skip to content

Commit

Permalink
Merge pull request #5339 from AnalyticalGraphicsInc/clamping-caching-…
Browse files Browse the repository at this point in the history
…calamity

Fix billboard clamping bug
  • Loading branch information
bagnell authored May 18, 2017
2 parents d63ec2a + 2dff9db commit 839bbb2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Change Log
* Fixed a crash when calling `Camera.pickEllipsoid` with a canvas of size 0.
* Fix `BoundingSphere.fromOrientedBoundingBox`. [#5334](https://github.com/AnalyticalGraphicsInc/cesium/issues/5334)
* Fixed bug where polylines would not update when `PolylineCollection` model matrix was updated [#5327](https://github.com/AnalyticalGraphicsInc/cesium/pull/5327)
* Fixed a bug where adding a ground clamped label without a position would show up at a previous label's clamped position. [#5338](https://github.com/AnalyticalGraphicsInc/cesium/issues/5338)
* Fixed translucency bug for certain material types [#5335](https://github.com/AnalyticalGraphicsInc/cesium/pull/5335)
* Fix picking polylines that use a depth fail appearance. [#5337](https://github.com/AnalyticalGraphicsInc/cesium/pull/5337)

Expand Down
2 changes: 1 addition & 1 deletion Source/Scene/Billboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ define([
if (!Cartesian3.equals(position, value)) {
Cartesian3.clone(value, position);
Cartesian3.clone(value, this._actualPosition);

this._updateClamping();
makeDirty(this, POSITION_INDEX);
}
Expand Down Expand Up @@ -956,6 +955,7 @@ define([

var position = ellipsoid.cartesianToCartographic(owner._position);
if (!defined(position)) {
owner._actualClampedPosition = undefined;
return;
}

Expand Down
4 changes: 4 additions & 0 deletions Specs/Scene/BillboardCollectionSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1877,6 +1877,10 @@ defineSuite([
scene.globe.callback(Cartesian3.fromDegrees(-72.0, 40.0, 100.0));
cartographic = scene.globe.ellipsoid.cartesianToCartographic(b._clampedPosition);
expect(cartographic.height).toEqualEpsilon(100.0, CesiumMath.EPSILON9);

//Setting position to zero should clear the clamped position.
b.position = Cartesian3.ZERO;
expect(b._clampedPosition).toBeUndefined();
});

it('changing the terrain provider', function() {
Expand Down

0 comments on commit 839bbb2

Please sign in to comment.