|
@@ -122,10 +122,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
|
|
|
|
|
|
this.depthSampler = new DepthImageSampler();
|
|
|
- this.addEventListener('loadedDepthImg',(e)=>{
|
|
|
- e.loaded && this.updateDepthTex(e.pano)
|
|
|
- })
|
|
|
-
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -299,6 +296,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
if(this.panos.length == 0)return
|
|
|
//this.modeChanging = true //主要是因为到全景图不会立刻成功
|
|
|
let wait = (e)=>{
|
|
|
+ console.log('flyToPanoDone')
|
|
|
this.removeEventListener('flyToPanoDone',wait)
|
|
|
setTimeout(()=>{
|
|
|
if(this.latestRequestMode == mode ){
|
|
@@ -331,21 +329,19 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
|
|
|
|
|
|
if(config2.showSkybox || config2.pointUsePanoTex){
|
|
|
- let wait = (e)=> {
|
|
|
- if(e.pano && e.pano != this.currentPano)return//loadedDepthImg
|
|
|
+ let wait = ( )=> {
|
|
|
+ console.log('waitdone')
|
|
|
+ //if(e.pano && e.pano != this.currentPano)return //loadedDepthImg
|
|
|
setTimeout( ()=>{
|
|
|
if(this.latestRequestMode == mode ){
|
|
|
Potree.settings.displayMode = mode
|
|
|
}
|
|
|
- },1)
|
|
|
- this.removeEventListener('loadedDepthImg', wait)
|
|
|
+ },1)
|
|
|
}
|
|
|
- if(!this.currentPano.depthTex && this.currentPano.pointcloud.hasDepthTex){
|
|
|
- this.addEventListener('loadedDepthImg', wait)
|
|
|
- return this.currentPano.loadDepthImg()
|
|
|
- }
|
|
|
+
|
|
|
//this.updateDepthTex()
|
|
|
if(this.checkAndWaitForPanoLoad(this.currentPano, this.basePanoSize, wait)){
|
|
|
+ console.log('等待贴图加载2', this.currentPano.id)
|
|
|
return
|
|
|
}
|
|
|
}
|
|
@@ -636,7 +632,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
|
|
|
cancelFlyToPano(toPano){//取消当前已有的飞行准备,前提是相机还未移动
|
|
|
if(viewer.mainViewport.view.isFlying() || toPano && this.latestToPano != toPano)return
|
|
|
- //Potree.Log('cancelFlyToPano', this.latestToPano && this.latestToPano.pano.id)
|
|
|
+ Potree.Log('cancelFlyToPano', this.latestToPano && this.latestToPano.pano.id)
|
|
|
this.nextPano = null
|
|
|
this.latestToPano = null
|
|
|
}
|
|
@@ -665,7 +661,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
}
|
|
|
|
|
|
if(!toPano.pano.enabled)return done(false,true);
|
|
|
- //Potree.Log('hope flyToPano: '+toPano.pano.id )
|
|
|
+ Potree.Log('hope flyToPano: '+toPano.pano.id )
|
|
|
|
|
|
|
|
|
if(this.latestToPano && this.latestToPano != toPano && this.latestToPano.pano != this.currentPano){//还在飞//如果旧的toPano只是旋转镜头,就直接取消旧的
|
|
@@ -694,17 +690,18 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
{//不飞的话是否不要执行这段?
|
|
|
|
|
|
let wait = (e)=> {
|
|
|
- if(e.pano && this.latestToPano && e.pano != this.latestToPano.pano)return//loadedDepthImg
|
|
|
- if(this.latestToPano != toPano)return /* Potree.Log('已经取消') *///如果取消了
|
|
|
+ console.log('wait done', pano.id)
|
|
|
+ if(/* e.pano && */this.latestToPano && pano != this.latestToPano.pano)return//loadedDepthImg
|
|
|
+ if(this.latestToPano != toPano)return Potree.Log('已经取消', pano.id) //如果取消了
|
|
|
setTimeout(()=>{
|
|
|
if(this.latestToPano != toPano)return
|
|
|
this.flyToPano(toPano)
|
|
|
},1)
|
|
|
- this.removeEventListener('loadedDepthImg', wait)
|
|
|
+
|
|
|
}
|
|
|
if(!pano.depthTex && pano.pointcloud.hasDepthTex){ //点云模式也要加载depthTex,因获取neighbour需要用到
|
|
|
- //console.log('等待加载depthtex')
|
|
|
- this.addEventListener('loadedDepthImg', wait)
|
|
|
+ console.log('等待加载depthtex', pano.id)
|
|
|
+ pano.addEventListener('loadedDepthImg', wait, {once:true})
|
|
|
return pano.loadDepthImg()
|
|
|
}
|
|
|
|
|
@@ -714,10 +711,9 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
toPano.useBound = true
|
|
|
}
|
|
|
|
|
|
- /* let wait2 = (e)=>{
|
|
|
- setTimeout(wait.bind(this,e),400 )
|
|
|
- } */
|
|
|
+
|
|
|
if(this.checkAndWaitForPanoLoad(pano, toPano.basePanoSize || this.basePanoSize, wait )){
|
|
|
+ console.log('等待贴图加载',pano.id)
|
|
|
return
|
|
|
}
|
|
|
}
|