From 7cda13eb1934b926d25665fb880e6d851589453d Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Wed, 21 Feb 2018 13:57:58 -0500 Subject: [PATCH] Set highest priority for globe tiles that you are inside --- Source/Scene/GlobeSurfaceTile.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Scene/GlobeSurfaceTile.js b/Source/Scene/GlobeSurfaceTile.js index 1026832675b8..e9b9e76d1216 100644 --- a/Source/Scene/GlobeSurfaceTile.js +++ b/Source/Scene/GlobeSurfaceTile.js @@ -7,6 +7,7 @@ define([ '../Core/defineProperties', '../Core/IntersectionTests', '../Core/PixelFormat', + '../Core/Rectangle', '../Renderer/PixelDatatype', '../Renderer/Sampler', '../Renderer/Texture', @@ -28,6 +29,7 @@ define([ defineProperties, IntersectionTests, PixelFormat, + Rectangle, PixelDatatype, Sampler, Texture, @@ -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); }; }