|
@@ -79320,8 +79320,7 @@ void main()
|
|
|
let prop = Object.assign({
|
|
|
lineWidth: o.lineWidth || 1,
|
|
|
//windows无效。 似乎mac/ios上粗细有效 ?
|
|
|
- color: o.color || defaultColor,
|
|
|
- //depthTest : false,
|
|
|
+ color: o.color || defaultColor
|
|
|
},o);
|
|
|
if(o.deshed ){
|
|
|
prop.dashSize = o.dashSize || 0.1,
|
|
@@ -89189,6 +89188,10 @@ void main()
|
|
|
});
|
|
|
|
|
|
this.computeCount = 0;
|
|
|
+ this.maxLoading = 3;
|
|
|
+ this.loadFailCount = 0;
|
|
|
+ this.loadingInProgress = 0;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
get zoomLevel(){
|
|
@@ -89240,7 +89243,7 @@ void main()
|
|
|
setEnable(enable){//add
|
|
|
if(!this.disabled == enable)return
|
|
|
if(enable){
|
|
|
- console.log('setEnable',true);
|
|
|
+ //console.log('setEnable',true)
|
|
|
}
|
|
|
this.disabled = !enable;
|
|
|
|
|
@@ -89293,9 +89296,9 @@ void main()
|
|
|
let lonlat = viewer.transform.lonlatToLocal.inverse(viewport.camera.position.clone());
|
|
|
let cos = Math.cos(MathUtils.degToRad(lonlat.y)); //越小就在纬度上越高,tile表现越小
|
|
|
//为什么lonlat.y会超出90?
|
|
|
- if(lonlat.y>90){
|
|
|
- console.log('lonlat.y>90',lonlat.y);
|
|
|
- }
|
|
|
+ /* if(lonlat.y>90){
|
|
|
+ console.log('lonlat.y>90',lonlat.y)
|
|
|
+ } */
|
|
|
|
|
|
cos = MathUtils.clamp(cos, 0,1);
|
|
|
let lonShift = Math.abs(viewer.mapViewer.camera.position.x / this.mapSizeM * 16 ); //越大就在经度离中心越远,tile表现越大 。
|
|
@@ -89392,11 +89395,12 @@ void main()
|
|
|
|
|
|
|
|
|
|
|
|
- let maxLoading = 3;
|
|
|
- let loadFailCount = 0;
|
|
|
+
|
|
|
const waitQueue = []; //等待加载的
|
|
|
const loadDone = (tile, success)=>{
|
|
|
tile.map.mapLayer.loadingInProgress--;
|
|
|
+ tile.map.loadingInProgress--;
|
|
|
+
|
|
|
tile.loading = false;
|
|
|
|
|
|
let next = waitQueue[0];
|
|
@@ -89410,14 +89414,14 @@ void main()
|
|
|
tile.mesh && (tile.mesh.material.needsUpdate = true);
|
|
|
|
|
|
};
|
|
|
- let lastTile;
|
|
|
+
|
|
|
function addLoadTile(tile){
|
|
|
|
|
|
- if(tile.map.mapLayer.loadingInProgress < maxLoading){
|
|
|
+ if(tile.map.loadingInProgress < tile.map.maxLoading){
|
|
|
if(!tile.mesh)return; //有时候会遇到这种情况, 为什么没有被cancelLoad呢?
|
|
|
|
|
|
-
|
|
|
- tile.map.mapLayer.loadingInProgress ++;
|
|
|
+ tile.map.mapLayer.loadingInProgress++;
|
|
|
+ tile.map.loadingInProgress ++;
|
|
|
//tile.texURL && tile.texURL.includes('testdata') && console.log('addLoadTile', tile.texURL.split('map_tiles/')[1] )
|
|
|
|
|
|
tile.loading = true;
|
|
@@ -89433,10 +89437,10 @@ void main()
|
|
|
tile.map.mapLayer.needUpdate = true; //表示还要继续update(以removeChildren)
|
|
|
|
|
|
if(tile.map instanceof TiledMapOpenStreetMap){
|
|
|
- maxLoading = browser.isMobile() ? 5 : 10;
|
|
|
+ tile.map.maxLoading = browser.isMobile() ? 5 : 10;
|
|
|
}
|
|
|
}else {
|
|
|
- tile.texURL && tile.texURL.includes('testdata') && console.log('loadDone and dispose', tile.texURL.split('map_tiles/')[1] );
|
|
|
+ //tile.texURL && tile.texURL.includes('testdata') && console.log('loadDone and dispose', tile.texURL.split('map_tiles/')[1] )
|
|
|
tex.dispose();
|
|
|
}
|
|
|
loadDone(tile, true);
|
|
@@ -89448,10 +89452,10 @@ void main()
|
|
|
tile.map.mapLayer.viewer.mapChanged = true;
|
|
|
}
|
|
|
loadDone(tile, false);
|
|
|
- loadFailCount ++ ;
|
|
|
+ tile.map.loadFailCount ++ ;
|
|
|
|
|
|
- if(tile.map instanceof TiledMapOpenStreetMap && Potree.settings.mapCompany == 'google' && loadFailCount > 3){//极有可能没有vpn为了防止影响到其他资源加载,减少加载的个数
|
|
|
- maxLoading = 2;
|
|
|
+ if(tile.map instanceof TiledMapOpenStreetMap && Potree.settings.mapCompany == 'google' && tile.map.loadFailCount > 3){//极有可能没有vpn为了防止影响到其他资源加载,减少加载的个数
|
|
|
+ tile.map.maxLoading = 2;
|
|
|
}
|
|
|
|
|
|
}));
|
|
@@ -89470,12 +89474,9 @@ void main()
|
|
|
|
|
|
if(!tile.loading){
|
|
|
let index = waitQueue.indexOf(tile);
|
|
|
- index > -1 && waitQueue.splice(index,1);
|
|
|
- //if(index == -1) console.error('cancelLoad index == -1', tile.id)
|
|
|
-
|
|
|
- index > -1 && tile.texURL && tile.texURL.includes('testdata') && console.log('cancelLoad', tile.texURL.split('map_tiles/')[1]/* , (log && waitQueue.indexOf(tile)>-1) ? log:'' , tile.loading */ );
|
|
|
-
|
|
|
-
|
|
|
+ index > -1 && waitQueue.splice(index,1);
|
|
|
+ //index > -1 && tile.texURL && tile.texURL.includes('testdata') && console.log('cancelLoad', tile.texURL.split('map_tiles/')[1]/* , (log && waitQueue.indexOf(tile)>-1) ? log:'' , tile.loading */ )
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -98058,13 +98059,15 @@ void main()
|
|
|
};
|
|
|
|
|
|
if(!toPano.pano.enabled)return done(false,true);
|
|
|
- //Potree.Log('hope flyToPano: '+toPano.pano.id )
|
|
|
+ //Potree.Log('hope flyToPano: '+toPano.pano.id, toPano.pano.position.toArray() )
|
|
|
|
|
|
|
|
|
if(this.latestToPano && this.latestToPano != toPano && this.latestToPano.pano != this.currentPano){//还在飞//如果旧的toPano只是旋转镜头,就直接取消旧的
|
|
|
return done(false)
|
|
|
}
|
|
|
- //Potree.Log('flyToPano: '+toPano.pano.id, this.latestToPano && this.latestToPano.pano.id )
|
|
|
+
|
|
|
+ //Potree.Log('flyToPano: '+toPano.pano.id, toPano.pano.position.toArray() /* this.latestToPano && this.latestToPano.pano.id */ )
|
|
|
+
|
|
|
if(this.currentPano == toPano.pano && this.isAtPano() && !toPano.target && !toPano.quaternion ){
|
|
|
this.dispatchEvent({type:'flyToPano', toPano});
|
|
|
return done(true);
|
|
@@ -119708,7 +119711,7 @@ ENDSEC
|
|
|
} */
|
|
|
|
|
|
{//连接时的辅助线
|
|
|
- this.linkGuideLine = LineDraw.createLine([], {color:'#aaa', deshed:true, dashSize:0.1,gapSize:0.1,});
|
|
|
+ this.linkGuideLine = LineDraw.createLine([], {color:'#ddd', deshed:true, dashSize:0.1,gapSize:0.05, depthTest:false});
|
|
|
this.linkGuideLine.visible = false;
|
|
|
this.linkGuideLine.name = 'linkGuideLine';
|
|
|
viewer.scene.scene.add(this.linkGuideLine);
|
|
@@ -119721,7 +119724,7 @@ ENDSEC
|
|
|
if(this.activeViewName == 'top' ){
|
|
|
endPos = e.intersect.orthoIntersect.clone().setZ(this.selectedPano.position.z);
|
|
|
}else if(this.activeViewName == 'mainView' ){
|
|
|
- if(!e.intersect.point)return
|
|
|
+ if(!e.intersect || !e.intersect.point)return
|
|
|
endPos = e.intersect.point.position;
|
|
|
}
|
|
|
|
|
@@ -120625,7 +120628,7 @@ ENDSEC
|
|
|
}
|
|
|
|
|
|
|
|
|
- {//自动切换楼层
|
|
|
+ if(this.currentFloor != 'all'){//如果原本不是展示全部楼层的话,自动切换楼层
|
|
|
|
|
|
let atFloor = SiteModel$1.entities.find(e=>e.buildType == 'floor' && e.panos.includes(pano));
|
|
|
if(!atFloor){
|
|
@@ -155048,7 +155051,7 @@ ENDSEC
|
|
|
options: {
|
|
|
//dracoDecoderPath: '../utils/loaders/DRACOLoader/draco',
|
|
|
//basisTranscoderPath: '../utils/loaders/KTX2Loader/basis',
|
|
|
- maximumScreenSpaceError: 50,
|
|
|
+ maximumScreenSpaceError: 30, //如果本身tiles很密很小这个值就不能很大。
|
|
|
maxDepth: 100,
|
|
|
maximumMemoryUsage: 700, //缓存大小。 若太小,密集的tile反复加载很卡
|
|
|
//debug:true,
|