Explorar el Código

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 hace 3 años
padre
commit
9914f4583f
Se han modificado 1 ficheros con 3 adiciones y 7 borrados
  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;