Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Sep 12, 2018
1 parent 27a1683 commit 3ff4d23
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Change Log
* Added `cartographicLimitRectangle` to `Globe`. Use this to limit terrain and imagery to a specific `Rectangle` area. [#6987](https://github.com/AnalyticalGraphicsInc/cesium/pull/6987)

##### Fixes :wrench:
* Fixed an issue in the 3D Tiles traversal where external tilesets would not always traverse to their root tile. [#7035](https://github.com/AnalyticalGraphicsInc/cesium/pull/7035)
* 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)

### 1.49 - 2018-09-04
Expand Down
5 changes: 1 addition & 4 deletions Source/Scene/Cesium3DTilesetTraversal.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,10 @@ define([
return false;
}
if (tile.hasTilesetContent) {
// Traverse external tileset to visit its root tile.
// Traverse external tileset to visit its root tile
// Don't traverse if the subtree is expired because it will be destroyed
return !tile.contentExpired;
}
if (tile.hasTilesetContent) {
return true;
}
return tile._screenSpaceError > tileset._maximumScreenSpaceError;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
88
]
},
"geometricError": 240,
"geometricError": 70,
"refine": "ADD",
"content": {
"uri": "tileset2.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
20
]
},
"geometricError": 70,
"geometricError": 0,
"content": {
"uri": "tileset3/tileset3.json"
}
Expand Down
12 changes: 10 additions & 2 deletions Specs/Scene/Cesium3DTilesetSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1079,8 +1079,7 @@ defineSuite([
//
return Cesium3DTilesTester.loadTileset(scene, tilesetReplacement1Url).then(function(tileset) {
tileset.root.geometricError = 90;
viewRootOnly();
scene.camera.zoomIn(20);
setZoom(80);
scene.renderForSpecs();

var statistics = tileset._statistics;
Expand Down Expand Up @@ -1364,6 +1363,15 @@ defineSuite([
});
});

it('always visits external tileset root', function() {
viewRootOnly();
return Cesium3DTilesTester.loadTileset(scene, tilesetOfTilesetsUrl).then(function(tileset) {
var statistics = tileset._statistics;
expect(statistics.visited).toEqual(2); // Visits external tileset tile, and external tileset root
expect(statistics.numberOfCommands).toEqual(1); // Renders external tileset root
});
});

it('set tile color', function() {
return Cesium3DTilesTester.loadTileset(scene, noBatchIdsUrl).then(function(tileset) {
// Get initial color
Expand Down

0 comments on commit 3ff4d23

Please sign in to comment.