Skip to content

Commit

Permalink
Merge pull request #1 from AnalyticalGraphicsInc/master
Browse files Browse the repository at this point in the history
update fork
  • Loading branch information
dennisadams committed Jun 6, 2019
2 parents da2ac90 + 90b130e commit 5311dc8
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 28 deletions.
10 changes: 8 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
Change Log
==========

### 1.59 - 2019-07-01

##### Fixes :wrench:
* Fixed a bug that caused missing segments for ground polylines with coplanar points over large distances and problems with polylines containing duplicate points. [#7885](https://github.com/AnalyticalGraphicsInc/cesium//pull/7885)
* Fixed a bug where billboards were not pickable when zoomed out completely in 2D View. [#7908](https://github.com/AnalyticalGraphicsInc/cesium/pull/7908)

### 1.58.1 - 2018-06-03
_This is an npm-only release to fix a publishing issue__
_This is an npm-only release to fix a publishing issue_

### 1.58 - 2019-06-03

Expand All @@ -17,7 +23,7 @@ _This is an npm-only release to fix a publishing issue__
##### Fixes :wrench:
* Fixed an edge case where Cesium would provide ion access token credentials to non-ion servers if the actual asset entrypoint was being hosted by ion. [#7839](https://github.com/AnalyticalGraphicsInc/cesium/pull/7839)
* Fixed a bug that caused Cesium to request non-existent tiles for terrain tilesets lacking tile availability, i.e. a `layer.json` file.
* Fixed memory leak when removing entities that had a `HeightReference` of `CLAMP_TO_GROUND` or `RELATIVE_TO_GROUND`. This includes when removing a `DataSource`.
* Fixed memory leak when removing entities that had a `HeightReference` of `CLAMP_TO_GROUND` or `RELATIVE_TO_GROUND`. This includes when removing a `DataSource`.
* Fixed 3D Tiles credits not being shown in the data attribution box. [#7877](https://github.com/AnalyticalGraphicsInc/cesium/pull/7877)

### 1.57 - 2019-05-01
Expand Down
45 changes: 23 additions & 22 deletions Source/Core/GroundPolylineGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,41 +353,42 @@ define([
return result;
}

function tangentDirection(target, origin, up, result) {
result = direction(target, origin, result);

// orthogonalize
result = Cartesian3.cross(result, up, result);
result = Cartesian3.normalize(result, result);
result = Cartesian3.cross(up, result, result);
return result;
}

var toPreviousScratch = new Cartesian3();
var toNextScratch = new Cartesian3();
var forwardScratch = new Cartesian3();
var coplanarNormalScratch = new Cartesian3();
var coplanarPlaneScratch = new Plane(Cartesian3.UNIT_X, 0.0);
var vertexUpScratch = new Cartesian3();
var cosine90 = 0.0;
var cosine180 = -1.0;
function computeVertexMiterNormal(previousBottom, vertexBottom, vertexTop, nextBottom, result) {
var up = direction(vertexTop, vertexBottom, vertexUpScratch);
var toPrevious = direction(previousBottom, vertexBottom, toPreviousScratch);
var toNext = direction(nextBottom, vertexBottom, toNextScratch);

// Check if points are coplanar in a right-side-pointing plane that contains "up."
// This is roughly equivalent to the points being colinear in cartographic space.
var coplanarNormal = Cartesian3.cross(up, toPrevious, coplanarNormalScratch);
coplanarNormal = Cartesian3.normalize(coplanarNormal, coplanarNormal);
var coplanarPlane = Plane.fromPointNormal(vertexBottom, coplanarNormal, coplanarPlaneScratch);
var nextBottomDistance = Plane.getPointDistance(coplanarPlane, nextBottom);
if (CesiumMath.equalsEpsilon(nextBottomDistance, 0.0, CesiumMath.EPSILON7)) {
// If the points are coplanar, point the normal in the direction of the plane
Cartesian3.clone(coplanarNormal, result);
return result;

// Compute vectors pointing towards neighboring points but tangent to this point on the ellipsoid
var toPrevious = tangentDirection(previousBottom, vertexBottom, up, toPreviousScratch);
var toNext = tangentDirection(nextBottom, vertexBottom, up, toNextScratch);

// Check if tangents are almost opposite - if so, no need to miter.
if (CesiumMath.equalsEpsilon(Cartesian3.dot(toPrevious, toNext), cosine180, CesiumMath.EPSILON5)) {
result = Cartesian3.cross(up, toPrevious, result);
result = Cartesian3.normalize(result, result);
return result;
}

// Average directions to previous and to next
// Average directions to previous and to next in the plane of Up
result = Cartesian3.add(toNext, toPrevious, result);
result = Cartesian3.normalize(result, result);

// Rotate this direction to be orthogonal to up
var forward = Cartesian3.cross(up, result, forwardScratch);
Cartesian3.normalize(forward, forward);
Cartesian3.cross(forward, up, result);
Cartesian3.normalize(result, result);

// Flip the normal if it isn't pointing roughly bound right (aka if forward is pointing more "backwards")
var forward = Cartesian3.cross(up, result, forwardScratch);
if (Cartesian3.dot(toNext, forward) < cosine90) {
result = Cartesian3.negate(result, result);
}
Expand Down
2 changes: 2 additions & 0 deletions Source/Scene/GlobeDepth.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ define([
});
}

globeDepth._copyColorCommand.renderState = globeDepth._rs;

if (!defined(globeDepth._tempCopyDepthCommand)) {
globeDepth._tempCopyDepthCommand = context.createViewportQuadCommand(PassThroughDepth, {
uniformMap : {
Expand Down
7 changes: 3 additions & 4 deletions Specs/Core/GroundPolylineGeometrySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ defineSuite([
positions : Cartesian3.fromDegreesArray([
0.01, 0.0,
0.02, 0.0,
0.01, 0.0
0.01, CesiumMath.EPSILON7
]),
granularity : 0.0
});
Expand All @@ -299,11 +299,10 @@ defineSuite([

var miteredStartNormal = Cartesian3.unpack(startNormalAndForwardOffsetZvalues, 32);
var miteredEndNormal = Cartesian3.unpack(endNormalAndTextureCoordinateNormalizationXvalues, 0);
var reverseMiteredEndNormal = Cartesian3.multiplyByScalar(miteredEndNormal, -1.0, new Cartesian3());

expect(Cartesian3.equalsEpsilon(miteredStartNormal, reverseMiteredEndNormal, CesiumMath.EPSILON7)).toBe(true);
expect(Cartesian3.equalsEpsilon(miteredStartNormal, miteredEndNormal, CesiumMath.EPSILON7)).toBe(true);

var approximateExpectedMiterNormal = new Cartesian3(0.0, 1.0, 0.0);
var approximateExpectedMiterNormal = new Cartesian3(0.0, -1.0, 0.0);

Cartesian3.normalize(approximateExpectedMiterNormal, approximateExpectedMiterNormal);
expect(Cartesian3.equalsEpsilon(approximateExpectedMiterNormal, miteredStartNormal, CesiumMath.EPSILON2)).toBe(true);
Expand Down

0 comments on commit 5311dc8

Please sign in to comment.