diff --git a/example/src/FadeManager.js b/example/src/FadeManager.js index 181943dfd..8a867974e 100644 --- a/example/src/FadeManager.js +++ b/example/src/FadeManager.js @@ -243,11 +243,6 @@ export class FadeManager { state.fadeIn = fadeIn; state.fadeOut = fadeOut; - // TODO: if we're at a "stable" state - ie reached the target values, then we - // should adjust the material define - // TODO: properly remove the tiles once the fade out has finished - // TODO: don't dispose of tiles until they've been faded out - // update the material fields const defineValue = Number( fadeOut !== fadeOutTarget || fadeIn !== fadeInTarget ); object.traverse( child => { @@ -270,7 +265,7 @@ export class FadeManager { } ); - if ( fadeOut === 1.0 ) { + if ( fadeOut === 1.0 || fadeOut > fadeIn ) { this.completeFade( object ); diff --git a/example/src/FadeTilesRenderer.js b/example/src/FadeTilesRenderer.js index ee22bf8e9..8bc7495ff 100644 --- a/example/src/FadeTilesRenderer.js +++ b/example/src/FadeTilesRenderer.js @@ -4,9 +4,6 @@ import { FadeManager } from './FadeManager.js'; function onTileVisibilityChange( scene, tile, visible ) { - - - if ( ! visible ) { this._fadeGroup.add( scene ); @@ -68,7 +65,7 @@ function onFadeFinish( object ) { } -export class FadeTilesRenderer extends TilesRenderer { +export const FadeTilesRendererMixin = base => class extends base { get fadeDuration() { @@ -127,4 +124,6 @@ export class FadeTilesRenderer extends TilesRenderer { } -} +}; + +export const FadeTilesRenderer = FadeTilesRendererMixin( TilesRenderer );