@@ -304,7 +304,7 @@ define([
304
304
} ;
305
305
306
306
BaseTraversal . prototype . getChildren = function ( tile ) {
307
- if ( this . updateAndCheckChildren ( tile ) ) {
307
+ if ( baseUpdateAndCheckChildren ( this . tileset , tile , this . baseScreenSpaceError , this . frameState ) ) {
308
308
var children = tile . children ;
309
309
var childrenLength = children . length ;
310
310
var allReady = true ;
@@ -331,14 +331,12 @@ define([
331
331
return emptyArray ;
332
332
} ;
333
333
334
- BaseTraversal . prototype . updateAndCheckChildren = function ( tile ) {
335
- var tileset = this . tileset ;
336
-
334
+ function baseUpdateAndCheckChildren ( tileset , tile , baseScreenSpaceError , frameState ) {
337
335
if ( tile . hasTilesetContent ) {
338
336
// load any tilesets of tilesets now because at this point we still have not achieved a base level of content
339
- loadTile ( tile , this . frameState ) ;
337
+ loadTile ( tile , frameState ) ;
340
338
if ( tile . contentReady ) {
341
- updateChildren ( tileset , tile , this . frameState ) ;
339
+ updateChildren ( tileset , tile , frameState ) ;
342
340
}
343
341
return true ;
344
342
}
@@ -348,13 +346,13 @@ define([
348
346
}
349
347
350
348
// stop traversal when we've attained the desired level of error
351
- if ( tile . _screenSpaceError <= this . baseScreenSpaceError ) {
349
+ if ( tile . _screenSpaceError <= baseScreenSpaceError ) {
352
350
// When skipping LODs, require an existing base level of content first
353
- updateChildren ( tileset , tile , this . frameState ) ;
351
+ updateChildren ( tileset , tile , frameState ) ;
354
352
return false ;
355
353
}
356
354
357
- var childrenVisibility = updateChildren ( tileset , tile , this . frameState ) ;
355
+ var childrenVisibility = updateChildren ( tileset , tile , frameState ) ;
358
356
var showAdditive = tile . refine === Cesium3DTileRefine . ADD ;
359
357
var showReplacement = tile . refine === Cesium3DTileRefine . REPLACE && ( childrenVisibility & Cesium3DTileChildrenVisibility . VISIBLE_IN_REQUEST_VOLUME ) !== 0 ;
360
358
@@ -407,7 +405,7 @@ define([
407
405
} ;
408
406
409
407
InternalBaseTraversal . prototype . getChildren = function ( tile ) {
410
- if ( this . updateAndCheckChildren ( tile , this . baseScreenSpaceError ) ) {
408
+ if ( baseUpdateAndCheckChildren ( this . tileset , tile , this . baseScreenSpaceError , this . frameState ) ) {
411
409
var children = tile . children ;
412
410
var childrenLength = children . length ;
413
411
for ( var i = 0 ; i < childrenLength ; ++ i ) {
@@ -580,6 +578,10 @@ define([
580
578
} ;
581
579
582
580
function updateChildren ( tileset , tile , frameState ) {
581
+ if ( tile . _lastVisitedFrame === frameState . frameNumber ) {
582
+ return tile . childrenVisibility ;
583
+ }
584
+
583
585
var children = tile . children ;
584
586
585
587
updateTransforms ( children , tile . computedTransform ) ;
0 commit comments