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

fix bounding volumes for hemisphere-size GroundPolylineGeometry #7052

Merged
merged 2 commits into from
Sep 20, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Change Log
* Fixed an issue in the 3D Tiles traversal where empty tiles would be selected instead of their nearest loaded ancestors. [#7011](https://github.com/AnalyticalGraphicsInc/cesium/pull/7011)
* 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 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

Expand Down
9 changes: 2 additions & 7 deletions Source/Core/GroundPolylineGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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({
Expand Down
1 change: 1 addition & 0 deletions Specs/Core/GroundPolylineGeometrySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down