@@ -418,6 +418,7 @@ export class TilesRendererBase {
418418
419419 update ( ) {
420420
421+ // load root
421422 const { lruCache, usedSet, stats, root, downloadQueue, parseQueue, processNodeQueue, optimizedLoadStrategy } = this ;
422423 if ( this . rootLoadingState === UNLOADED ) {
423424
@@ -471,6 +472,40 @@ export class TilesRendererBase {
471472
472473 }
473474
475+ // check if the plugins that can block the tile updates require it
476+ let needsUpdate = null ;
477+ this . invokeAllPlugins ( plugin => {
478+
479+ if ( plugin . doTilesNeedUpdate ) {
480+
481+ const res = plugin . doTilesNeedUpdate ( ) ;
482+ if ( needsUpdate === null ) {
483+
484+ needsUpdate = res ;
485+
486+ } else {
487+
488+ needsUpdate = Boolean ( needsUpdate || res ) ;
489+
490+ }
491+
492+ }
493+
494+ } ) ;
495+
496+ if ( needsUpdate === false ) {
497+
498+ this . dispatchEvent ( { type : 'update-before' } ) ;
499+ this . dispatchEvent ( { type : 'update-after' } ) ;
500+ return ;
501+
502+ }
503+
504+ // follow through with the update
505+ this . dispatchEvent ( { type : 'update-before' } ) ;
506+
507+ //
508+
474509 stats . inFrustum = 0 ;
475510 stats . used = 0 ;
476511 stats . active = 0 ;
@@ -485,6 +520,9 @@ export class TilesRendererBase {
485520 downloadQueue . priorityCallback = priorityCallback ;
486521 parseQueue . priorityCallback = priorityCallback ;
487522
523+ // prepare for traversal
524+ this . prepareForTraversal ( ) ;
525+
488526 // run traversal
489527 if ( optimizedLoadStrategy ) {
490528
@@ -527,6 +565,8 @@ export class TilesRendererBase {
527565
528566 }
529567
568+ this . dispatchEvent ( { type : 'update-after' } ) ;
569+
530570 }
531571
532572 resetFailedTiles ( ) {
@@ -621,6 +661,8 @@ export class TilesRendererBase {
621661
622662 }
623663
664+ prepareForTraversal ( ) { }
665+
624666 disposeTile ( tile ) {
625667
626668 // TODO: are these necessary? Are we disposing tiles when they are currently visible?
0 commit comments