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 intermittent clamp to ground failure #6930

Merged
merged 2 commits into from
Aug 17, 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 @@ -20,6 +20,7 @@ Change Log
* Fixed `getPickRay` in 2D. [#2480](https://github.com/AnalyticalGraphicsInc/cesium/issues/2480)
* Fixed `Globe.pick` for 2D and Columbus View [#6859](https://github.com/AnalyticalGraphicsInc/cesium/pull/6859)
* Fixed imagery layer feature picking in 2D and Columbus view [#6859](https://github.com/AnalyticalGraphicsInc/cesium/pull/6859)
* Fixed intermittent ground clamping issues for all entity types that use a height reference [#6930](https://github.com/AnalyticalGraphicsInc/cesium/pull/6930)
* Fixed bug that caused a new `ClippingPlaneCollection` to be created every frame when used with a model entity [#6872](https://github.com/AnalyticalGraphicsInc/cesium/pull/6872)
* Improved `Plane` entities so they are better aligned with the globe surface [#6887](https://github.com/AnalyticalGraphicsInc/cesium/pull/6887)
* Fixed crash when rendering translucent objects when all shadow maps in the scene set `fromLightSource` to false. [#6883](https://github.com/AnalyticalGraphicsInc/cesium/pull/6883)
Expand Down
14 changes: 13 additions & 1 deletion Source/Scene/QuadtreePrimitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -770,8 +770,11 @@ define([
var scratchRay = new Ray();
var scratchCartographic = new Cartographic();
var scratchPosition = new Cartesian3();
var scratchArray = [];

function updateHeights(primitive, frameState) {
var tryNextFrame = scratchArray;
tryNextFrame.length = 0;
var tilesToUpdateHeights = primitive._tileToUpdateHeights;
var terrainProvider = primitive._tileProvider.terrainProvider;

Expand All @@ -782,14 +785,20 @@ define([
var mode = frameState.mode;
var projection = frameState.mapProjection;
var ellipsoid = projection.ellipsoid;
var i;

while (tilesToUpdateHeights.length > 0) {
var tile = tilesToUpdateHeights[0];
if (tile.state !== QuadtreeTileLoadState.DONE) {
tryNextFrame.push(tile);
tilesToUpdateHeights.shift();
primitive._lastTileIndex = 0;
continue;
}
var customData = tile.customData;
var customDataLength = customData.length;

var timeSliceMax = false;
var i;
for (i = primitive._lastTileIndex; i < customDataLength; ++i) {
var data = customData[i];

Expand Down Expand Up @@ -869,6 +878,9 @@ define([
tilesToUpdateHeights.shift();
}
}
for (i = 0; i < tryNextFrame.length; i++) {
tilesToUpdateHeights.push(tryNextFrame[i]);
}
}

function createRenderCommandsForSelectedTiles(primitive, frameState) {
Expand Down