Selaa lähdekoodia

Merge pull request #101 from NASA-AMMOS/fix-offscreen-error

Fix offscreen error
Garrett Johnson 5 vuotta sitten
vanhempi
commit
859fe3a202
3 muutettua tiedostoa jossa 14 lisäystä ja 2 poistoa
  1. 1 0
      CHANGELOG.md
  2. 12 1
      TESTCASES.md
  3. 1 1
      src/base/traverseFunctions.js

+ 1 - 0
CHANGELOG.md

@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
 ### Fixed
 
 - Case where the url protocol was converted to use a single slash instead of two when loading a model.
+- Corner case where an error was thrown if the tileset was dragged off screen out of camera view.
 
 ## [0.1.3] - 2020-07-12
 ### Added

+ 12 - 1
TESTCASES.md

@@ -240,12 +240,23 @@ Verify that the tileset still renders correctly.
 
 #### steps
 
-1. Open the kitchen sink example with a remot tileset by navigating [here](https://nasa-ammos.github.io/3DTilesRendererJS/example/bundle/#https://raw.githubusercontent.com/NASA-AMMOS/3DTilesRendererJS/master/example/data/tileset.json).
+1. Open the kitchen sink example with a remote tileset by navigating [here](https://nasa-ammos.github.io/3DTilesRendererJS/example/bundle/#https://raw.githubusercontent.com/NASA-AMMOS/3DTilesRendererJS/master/example/data/tileset.json).
 
 #### expected
 
 Verify the tileset loads correctly and tehre are no errors in the console.
 
+## Verify example tileset can be dragged offscreen
+
+#### steps
+
+1. Open the kitchen sink example with the no root content tileset by navigating [here](https://nasa-ammos.github.io/3DTilesRendererJS/example/bundle/#../data/tileset-no-root-content.json).
+1. Slowly move the tileset offscreen by right clicking and dragging the view.
+
+#### expected
+
+Verify no errors are logged.
+
 ## Verify tile data is disposed of properly
 
 #### steps

+ 1 - 1
src/base/traverseFunctions.js

@@ -246,7 +246,7 @@ export function skipTraversal( tile, renderer ) {
 			tile.__active = true;
 			stats.active ++;
 
-		} else if ( ! lruCache.isFull() ) {
+		} else if ( ! lruCache.isFull() && ! tile.__contentEmpty ) {
 
 			renderer.requestTileContents( tile );