diff --git a/example/src/FadeManager.js b/example/src/FadeManager.js index 6b62e995f..99e7f0cbe 100644 --- a/example/src/FadeManager.js +++ b/example/src/FadeManager.js @@ -199,6 +199,16 @@ export class FadeManager { } + completeAllFades() { + + this._fadeState.forEach( ( value, key ) => { + + this.completeFade( key ); + + } ); + + } + // Fade the object in fadeIn( object ) { diff --git a/example/src/FadeTilesRenderer.js b/example/src/FadeTilesRenderer.js index 26f2c0dd9..ea691d96f 100644 --- a/example/src/FadeTilesRenderer.js +++ b/example/src/FadeTilesRenderer.js @@ -10,6 +10,13 @@ const _scale = new Vector3(); function onTileVisibilityChange( scene, tile, visible ) { + // ensure the tiles are fading to the right target before stopping fade + if ( this.isMovingFast ) { + + this._fadeManager.completeFade( scene ); + + } + // ensure the tiles are marked as visible on visibility toggle since // it's possible we disable them when adjusting visibility based on frustum scene.visible = true; @@ -25,13 +32,6 @@ function onTileVisibilityChange( scene, tile, visible ) { } - // ensure the tiles are fading to the right target before stopping fade - if ( this.isMovingFast ) { - - this._fadeManager.completeFade( scene ); - - } - } function onLoadModel( scene ) { @@ -189,6 +189,13 @@ export const FadeTilesRendererMixin = base => class extends base { } ); + + if ( isMovingFast ) { + + this._fadeManager.completeAllFades(); + + } + } deleteCamera( camera ) {