|
@@ -279,6 +279,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
set: (mode)=> {
|
|
|
this.latestRequestMode = mode
|
|
|
console.warn('Request setMode: ' + mode)
|
|
|
+ this.dispatchEvent({type:'requestMode',mode})
|
|
|
let config2
|
|
|
|
|
|
let config = Potree.config.displayMode[mode]
|
|
@@ -1688,7 +1689,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
|
|
|
//等待部分加载完
|
|
|
checkAndWaitForTiledPanoLoad(pano, basePanoSize, callback1, callback2, progressCallback, iswait, isclear, l) {
|
|
|
-
|
|
|
+ console.log('checkAndWaitForTiledPanoLoad',pano.id)
|
|
|
if (!pano) {
|
|
|
console.error("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
|
|
|
}
|
|
@@ -1710,7 +1711,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
var fov = null //若不为null的话,因为可能可见范围的tile下载过了从而无法触发下载,然后得不到下载成功的消息,怎么办
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
pano.loadTiledPano(/* 1024 */ basePanoSize , vectorForward, fov, isclear, l, null).done(function(e, t) {
|
|
|
callback1 && callback1(e, t)
|
|
|
}
|
|
@@ -2424,13 +2425,29 @@ Images360.prototype.checkAndWaitForPanoLoad = function() {
|
|
|
return !1
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
return function(pano, basePanoSize, doneFun1, doneFun2, progressCallback, iswait, isclear, p ) {
|
|
|
loadedCallback[pano.id] = doneFun1//add 因为有可能之前请求的没加doneFun1, 如果加载好就执行最新的doneFun1
|
|
|
-
|
|
|
+
|
|
|
if (withinTime()){//距离上次请求时间很近
|
|
|
-
|
|
|
+ //console.log(11)
|
|
|
return !0; //这里感觉应该是!1
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ let changeMode = (e)=>{
|
|
|
+ if(e.mode == 'showPointCloud'){
|
|
|
+ console.warn('切到点云模式了,就删除loadedCallback记录',pano.id)//否则再次转为showPanos会被withinTime阻拦
|
|
|
+ delete isLoadedPanos[pano.id]
|
|
|
+ this.removeEventListener('requestMode', changeMode)
|
|
|
+ }
|
|
|
}
|
|
|
+ this.addEventListener('requestMode', changeMode)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -2450,8 +2467,7 @@ Images360.prototype.checkAndWaitForPanoLoad = function() {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- null !== iswait && void 0 !== iswait || (iswait = !0);
|
|
|
-
|
|
|
+ null !== iswait && void 0 !== iswait || (iswait = !0);
|
|
|
isLoadedPanos[pano.id] = this.checkAndWaitForTiledPanoLoad(pano, basePanoSize, callback1, callback2, progressCallback, iswait, isclear, p );
|
|
|
//true代表没加载好
|
|
|
isLoadedPanos[pano.id] && (LoadedTimePanos[pano.id] = performance.now());
|