Skip to content

Commit

Permalink
Set highest priority for globe tiles that you are inside
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Mar 29, 2018
1 parent e247462 commit 7cda13e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/Scene/GlobeSurfaceTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ define([
'../Core/defineProperties',
'../Core/IntersectionTests',
'../Core/PixelFormat',
'../Core/Rectangle',
'../Renderer/PixelDatatype',
'../Renderer/Sampler',
'../Renderer/Texture',
Expand All @@ -28,6 +29,7 @@ define([
defineProperties,
IntersectionTests,
PixelFormat,
Rectangle,
PixelDatatype,
Sampler,
Texture,
Expand Down Expand Up @@ -254,6 +256,10 @@ define([

function createPriorityFunction(surfaceTile, frameState) {
return function() {
if (Rectangle.contains(surfaceTile.tileBoundingRegion.rectangle, frameState.camera.positionCartographic)) {
// If the camera is inside this tile's bounding region treat it as highest priority
return 0.0;
}
return surfaceTile.tileBoundingRegion.distanceToCamera(frameState);
};
}
Expand Down

0 comments on commit 7cda13e

Please sign in to comment.