Sfoglia il codice sorgente

Fix flipped logic applying the autoDisableRendererCulling param

It was enabling ThreeJS renderer culling rather than disabling it.
Also fixed the traversal when dynamically toggling the param.
Jason Johnston 3 anni fa
parent
commit
9914f4583f
1 ha cambiato i file con 3 aggiunte e 7 eliminazioni
  1. 3 7
      src/three/TilesRenderer.js

+ 3 - 7
src/three/TilesRenderer.js

@@ -51,13 +51,9 @@ export class TilesRenderer extends TilesRendererBase {
 		if ( this._autoDisableRendererCulling !== value ) {
 
 			super._autoDisableRendererCulling = value;
-			this.traverse( tile => {
+			this.forEachLoadedModel( ( scene ) => {
 
-				if ( tile.scene ) {
-
-					updateFrustumCulled( tile.scene, value );
-
-				}
+				updateFrustumCulled( scene, ! value );
 
 			} );
 
@@ -673,7 +669,7 @@ export class TilesRenderer extends TilesRendererBase {
 				c[ INITIAL_FRUSTUM_CULLED ] = c.frustumCulled;
 
 			} );
-			updateFrustumCulled( scene, this.autoDisableRendererCulling );
+			updateFrustumCulled( scene, ! this.autoDisableRendererCulling );
 
 			cached.scene = scene;