@@ -28,11 +28,6 @@ const INITIAL_FRUSTUM_CULLED = Symbol( 'INITIAL_FRUSTUM_CULLED' );
2828const tempMat = /* @__PURE__ */ new Matrix4 ( ) ;
2929const tempVector = /* @__PURE__ */ new Vector3 ( ) ;
3030const tempVector2 = /* @__PURE__ */ new Vector2 ( ) ;
31- const viewErrorTarget = {
32- inView : true ,
33- error : 0 ,
34- distance : Infinity ,
35- } ;
3631
3732const X_AXIS = /* @__PURE__ */ new Vector3 ( 1 , 0 , 0 ) ;
3833const Y_AXIS = /* @__PURE__ */ new Vector3 ( 0 , 1 , 0 ) ;
@@ -784,6 +779,7 @@ export class TilesRenderer extends TilesRendererBase {
784779
785780 disposeTile ( tile ) {
786781
782+ // TODO: call this "disposeTileModel"?
787783 super . disposeTile ( tile ) ;
788784
789785 // This could get called before the tile has finished downloading
@@ -846,12 +842,6 @@ export class TilesRenderer extends TilesRendererBase {
846842
847843 }
848844
849- this . dispatchEvent ( {
850- type : 'dispose-model' ,
851- scene : engineData . scene ,
852- tile,
853- } ) ;
854-
855845 engineData . scene = null ;
856846 engineData . materials = null ;
857847 engineData . textures = null ;
@@ -888,13 +878,6 @@ export class TilesRenderer extends TilesRendererBase {
888878
889879 super . setTileVisible ( tile , visible ) ;
890880
891- this . dispatchEvent ( {
892- type : 'tile-visibility-change' ,
893- scene,
894- tile,
895- visible,
896- } ) ;
897-
898881 }
899882
900883 calculateBytesUsed ( tile , scene ) {
@@ -977,67 +960,6 @@ export class TilesRenderer extends TilesRendererBase {
977960
978961 }
979962
980- //
981-
982- // TODO: this logic is extremely complex. It may be more simple to have the plugin
983- // return a "should mask" field that indicates its "false" values should be respected
984- // rather than the function returning a "no-op" boolean.
985- // check the plugin visibility - each plugin will mask between themselves
986- let inRegion = null ;
987- let inRegionError = 0 ;
988- let inRegionDistance = Infinity ;
989- this . invokeAllPlugins ( plugin => {
990-
991- if ( plugin !== this && plugin . calculateTileViewError ) {
992-
993- // if function returns false it means "no operation"
994- viewErrorTarget . inView = true ;
995- viewErrorTarget . error = 0 ;
996- viewErrorTarget . distance = Infinity ;
997- if ( plugin . calculateTileViewError ( tile , viewErrorTarget ) ) {
998-
999- if ( inRegion === null ) {
1000-
1001- inRegion = true ;
1002-
1003- }
1004-
1005- // Plugins can set "inView" to false in order to mask the visible tiles
1006- inRegion = inRegion && viewErrorTarget . inView ;
1007- if ( viewErrorTarget . inView ) {
1008-
1009- inRegionDistance = Math . min ( inRegionDistance , viewErrorTarget . distance ) ;
1010- inRegionError = Math . max ( inRegionError , viewErrorTarget . error ) ;
1011-
1012- }
1013-
1014- }
1015-
1016- }
1017-
1018- } ) ;
1019-
1020- if ( target . inView && inRegion !== false ) {
1021-
1022- // if the tile is in camera view and we haven't encountered a region (null) or
1023- // the region is in view (true). regionInView === false means the tile is masked out.
1024- target . error = Math . max ( target . error , inRegionError ) ;
1025- target . distanceFromCamera = Math . min ( target . distanceFromCamera , inRegionDistance ) ;
1026-
1027- } else if ( inRegion ) {
1028-
1029- // if the tile is in a region then display it
1030- target . inView = true ;
1031- target . error = inRegionError ;
1032- target . distanceFromCamera = inRegionDistance ;
1033-
1034- } else {
1035-
1036- // otherwise write variables for load priority
1037- target . inView = false ;
1038-
1039- }
1040-
1041963 }
1042964
1043965 // adjust the rotation of the group such that Y is altitude, X is North, and Z is East
0 commit comments