Преглед на файлове

prioritize downloading tiles in frame before those out of frame

Garrett Johnson преди 4 години
родител
ревизия
d94a2f3921
променени са 1 файла, в които са добавени 5 реда и са изтрити 0 реда
  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