|
|
@@ -98742,6 +98742,7 @@ ENDSEC
|
|
|
let i = this.panos.indexOf(pano);
|
|
|
if(i>-1){
|
|
|
this.panos.splice(i,1);
|
|
|
+ this.currentPano == pano && (this.currentPano = null);
|
|
|
pano.dispatchEvent('dispose');
|
|
|
}
|
|
|
}
|
|
|
@@ -98772,7 +98773,7 @@ ENDSEC
|
|
|
if(!data || data.length == 0)return console.error( '没有漫游点')
|
|
|
|
|
|
data.forEach((info)=>{
|
|
|
- addPano(info);
|
|
|
+ this.addPano(info);
|
|
|
|
|
|
});
|
|
|
}
|
|
|
@@ -98814,7 +98815,7 @@ ENDSEC
|
|
|
if(!this.currentPano)return
|
|
|
|
|
|
Potree.Common.intervalTool.isWaiting('filterDepthTex', ()=>{
|
|
|
-
|
|
|
+ if(!this.currentPano)return
|
|
|
var s = [Images360.filters.not(this.currentPano )],
|
|
|
l = [Images360.scoreFunctions.distanceSquared(this.currentPano ), Images360.scoreFunctions.direction(this.position, this.getDirection())];
|
|
|
this.nearPanos = Common.sortByScore(this.panos, s, l).map(e=>e.item);
|
|
|
@@ -135252,8 +135253,8 @@ ENDSEC
|
|
|
});
|
|
|
|
|
|
this.modules.Clip.init();
|
|
|
-
|
|
|
- });
|
|
|
+ this.createHackMesh();
|
|
|
+ },{once:true});
|
|
|
|
|
|
|
|
|
|
|
|
@@ -139138,6 +139139,56 @@ ENDSEC
|
|
|
return r && r.score > 1 ? result[0].item : null
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ createHackMesh(){//为了防止无depthTex的全景在pick点云时画面中仅有一个材质时会黑屏,所以在镜头前再加一个mesh。具体bug表现见bug记录。
|
|
|
+ if(this.scene.pointclouds.every(e=>e.hasDepthTex) /* || viewer.images360.panos.length == 0 */)return
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ let mesh = new Mesh( new PlaneBufferGeometry(0.2,0.2) , new MeshBasicMaterial({color:"#F00",side:2/* ,depthTest:false */}));
|
|
|
+ Potree.Utils.updateVisible(mesh,'show',false);
|
|
|
+
|
|
|
+ this.images360.node.add(mesh);
|
|
|
+
|
|
|
+
|
|
|
+ let updatePos = ()=>{
|
|
|
+ let dir = this.mainViewport.view.direction;
|
|
|
+ let radius = this.images360.cube.scale.length();
|
|
|
+ mesh.position.copy(this.mainViewport.view.position).add(dir.multiplyScalar(radius));//放置skybox之外
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ this.addEventListener('camera_changed', e => {
|
|
|
+ if(e.viewport.name == 'MainView' && Potree.settings.displayMode == 'showPanos' && !this.images360.currentPano.depthTex
|
|
|
+ && e.changeInfo && (e.changeInfo.positionChanged || e.changeInfo.quaternionChanged)){
|
|
|
+ updatePos();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ let judge = ()=>{
|
|
|
+ if(Potree.settings.displayMode == 'showPanos' && !this.images360.currentPano.depthTex){
|
|
|
+ Potree.Utils.updateVisible(mesh,'show',true);
|
|
|
+ updatePos();
|
|
|
+ }else {
|
|
|
+ Potree.Utils.updateVisible(mesh,'show',false);
|
|
|
+ }
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ this.images360.addEventListener( 'flyToPanoDone', judge);
|
|
|
+
|
|
|
+ this.images360.addEventListener( 'endChangeMode', judge);
|
|
|
+
|
|
|
+
|
|
|
+ //不知道如果用点云计算非当前视角下的block会不会黑闪,如热点遮挡计算
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
/* addObjectTest1(){//加水管
|
|
|
|
|
|
if(Potree.settings.number == 't-8KbK1JjubE'){
|