diff --git a/CHANGES.md b/CHANGES.md index 9e2c962fb5bb..c50ebe33a5b8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -18,6 +18,7 @@ Change Log * Fixed an issue where scaling near zero with an model animation could cause rendering to stop. [#6954](https://github.com/AnalyticalGraphicsInc/cesium/pull/6954) * Fixed bug where credits weren't displaying correctly if more than one viewer was initialized [#6965](expect(https://github.com/AnalyticalGraphicsInc/cesium/issues/6965) * Fixed entity show issues. [#7048](https://github.com/AnalyticalGraphicsInc/cesium/issues/7048) +* Fixed a bug where polylines on terrain covering very large portions of the globe would cull incorrectly in 3d-only scenes. [#7043](https://github.com/AnalyticalGraphicsInc/cesium/issues/7043) ### 1.49 - 2018-09-04 diff --git a/Source/Core/GroundPolylineGeometry.js b/Source/Core/GroundPolylineGeometry.js index 3d0daaa5dee6..1c03744df648 100644 --- a/Source/Core/GroundPolylineGeometry.js +++ b/Source/Core/GroundPolylineGeometry.js @@ -697,7 +697,6 @@ define([ var normalNudgeScratch = new Cartesian3(); var scratchBoundingSpheres = [new BoundingSphere(), new BoundingSphere()]; - var boundingSphereCenterCartographicScratch = new Cartographic(); // Winding order is reversed so each segment's volume is inside-out var REFERENCE_INDICES = [ @@ -1061,12 +1060,8 @@ define([ BoundingSphere.fromVertices(topPositionsArray, Cartesian3.ZERO, 3, boundingSpheres[1]); var boundingSphere = BoundingSphere.fromBoundingSpheres(boundingSpheres); - // Adjust bounding sphere height and radius to cover whole volume - var midHeight = sumHeights / (segmentCount * 2.0); - var boundingSphereCenterCartographic = Cartographic.fromCartesian(boundingSphere.center, ellipsoid, boundingSphereCenterCartographicScratch); - boundingSphereCenterCartographic.height = midHeight; - boundingSphere.center = Cartographic.toCartesian(boundingSphereCenterCartographic, ellipsoid, boundingSphere.center); - boundingSphere.radius = Math.max(boundingSphere.radius, midHeight); + // Adjust bounding sphere height and radius to cover more of the volume + boundingSphere.radius += sumHeights / (segmentCount * 2.0); var attributes = { position : new GeometryAttribute({ diff --git a/Specs/Core/GroundPolylineGeometrySpec.js b/Specs/Core/GroundPolylineGeometrySpec.js index 27d67a0d8cf0..9fdcc6f2e00a 100644 --- a/Specs/Core/GroundPolylineGeometrySpec.js +++ b/Specs/Core/GroundPolylineGeometrySpec.js @@ -555,6 +555,7 @@ defineSuite([ var pointsDistance = Cartesian3.distance(positions[0], positions[1]); expect(boundingSphere.radius > pointsDistance).toBe(true); + expect(boundingSphere.radius > 1000.0).toBe(true); // starting top/bottom height }); var packedInstance = [positions.length];