Pārlūkot izejas kodu

prioritize downloading tiles in frame before those out of frame

Garrett Johnson 4 gadi atpakaļ
vecāks
revīzija
d94a2f3921
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. 5 0
      src/base/TilesRendererBase.js

+ 5 - 0
src/base/TilesRendererBase.js

@@ -19,6 +19,11 @@ const priorityCallback = ( a, b ) => {
 		// the lastFrameVisited tracks the last frame where a tile was used
 		return a.__lastFrameVisited - b.__lastFrameVisited;
 
+	} else if ( a.__inFrustum !== b.__inFrustum ) {
+
+		// prioritize loading whatever is in the frame
+		return a.__inFrustum ? 1 : - 1;
+
 	} else if ( a.__error !== b.__error ) {
 
 		// tiles which have greater error next