Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Dec 20, 2023
1 parent 7d88583 commit e8d62fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
7 changes: 1 addition & 6 deletions example/src/FadeManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -270,7 +265,7 @@ export class FadeManager {

} );

if ( fadeOut === 1.0 ) {
if ( fadeOut === 1.0 || fadeOut > fadeIn ) {

this.completeFade( object );

Expand Down
9 changes: 4 additions & 5 deletions example/src/FadeTilesRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import { FadeManager } from './FadeManager.js';

function onTileVisibilityChange( scene, tile, visible ) {




if ( ! visible ) {

this._fadeGroup.add( scene );
Expand Down Expand Up @@ -68,7 +65,7 @@ function onFadeFinish( object ) {

}

export class FadeTilesRenderer extends TilesRenderer {
export const FadeTilesRendererMixin = base => class extends base {

get fadeDuration() {

Expand Down Expand Up @@ -127,4 +124,6 @@ export class FadeTilesRenderer extends TilesRenderer {

}

}
};

export const FadeTilesRenderer = FadeTilesRendererMixin( TilesRenderer );

0 comments on commit e8d62fe

Please sign in to comment.