From aa0b7cb45be846a111331c8bf055503092c100ca Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Tue, 24 Dec 2024 22:23:48 +0900 Subject: [PATCH] updats --- src/plugins/three/fade/TilesFadePlugin.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/plugins/three/fade/TilesFadePlugin.js b/src/plugins/three/fade/TilesFadePlugin.js index e39e78fe5..c18c0a131 100644 --- a/src/plugins/three/fade/TilesFadePlugin.js +++ b/src/plugins/three/fade/TilesFadePlugin.js @@ -147,27 +147,22 @@ function onUpdateAfter() { // TODO const scene = t.cached.scene; - if ( ! scene ) { - - return; - - } // if a tile is fading out then it may not be traversed and thus will not have // the frustum flag set correctly. - if ( fadeManager.isFadingOut( t ) ) { - - scene.visible = true; + const isFadingOut = fadeManager.isFadingOut( t ); + if ( scene ) { - } else { + scene.visible = isFadingOut || t.__inFrustum; - if ( scene ) { + } - scene.visible = t.__inFrustum; + this.forEachBatchIds( ( id, batchedMesh, plugin ) => { - } + batchedMesh.setVisibleAt( id, isFadingOut || t.__inFrustum ); + plugin.batchedMesh.setVisibleAt( id, t.__inFrustum ); - } + } ); } );