Skip to content

Commit

Permalink
Added comments for the priority function
Browse files Browse the repository at this point in the history
  • Loading branch information
Avnerus committed Jun 10, 2021
1 parent dbc38a0 commit a8b6161
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/tiles/src/tileset/tile-3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ export default class TileHeader {
_getPriority() {
const traverser = this.tileset._traverser;
const {skipLevelOfDetail} = traverser.options;

/* Tiles that are outside of the camera's frustum could be skipped if we are in 'ADD' mode
* or if we are using 'Skip Traversal' in 'REPLACE' mode.
* In 'REPLACE' and 'Base Traversal' mode, all child tiles have to be loaded and displayed,
* including ones outide of the camera frustum, so that we can hide the parent tile. */
const maySkipTile = this.refine === TILE_REFINEMENT.ADD || skipLevelOfDetail;

// Check if any reason to abort
Expand All @@ -185,6 +190,7 @@ export default class TileHeader {
return -1;
}

// Based on the priority function `getPriorityReverseScreenSpaceError` in CesiumJS. Scheduling priority is based on the parent's screen space error when possible.
const parent = this.parent;
const useParentScreenSpaceError =
parent && (!maySkipTile || this._screenSpaceError === 0.0 || parent.hasTilesetContent);
Expand Down

0 comments on commit a8b6161

Please sign in to comment.