|
@@ -56235,7 +56235,7 @@
|
|
|
settings.isLocalhost = settings.prefix.includes('localhost');
|
|
settings.isLocalhost = settings.prefix.includes('localhost');
|
|
|
Potree.config = config$1;
|
|
Potree.config = config$1;
|
|
|
Potree.settings = settings;
|
|
Potree.settings = settings;
|
|
|
- console.log('2023-1');
|
|
|
|
|
|
|
+ Potree.versionDate = '20231229-0';
|
|
|
|
|
|
|
|
var MathLight = {};
|
|
var MathLight = {};
|
|
|
MathLight.RADIANS_PER_DEGREE = Math.PI / 180;
|
|
MathLight.RADIANS_PER_DEGREE = Math.PI / 180;
|
|
@@ -96884,7 +96884,7 @@ ENDSEC
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
changeImg(img, pano){
|
|
changeImg(img, pano){
|
|
|
-
|
|
|
|
|
|
|
+ console.warn('changeImg', pano.id);
|
|
|
this.pano = pano;
|
|
this.pano = pano;
|
|
|
let item = this.imgDatas.find(p=>p.pano == pano);
|
|
let item = this.imgDatas.find(p=>p.pano == pano);
|
|
|
if(/* this.img == img || */item){
|
|
if(/* this.img == img || */item){
|
|
@@ -96896,28 +96896,32 @@ ENDSEC
|
|
|
//console.log('重复使用',item.pano.id)
|
|
//console.log('重复使用',item.pano.id)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- viewer.addTimeMark('depthSampler','start');
|
|
|
|
|
- this.canvas.width = img.width;
|
|
|
|
|
- this.canvas.height = img.height;
|
|
|
|
|
- this.context.drawImage(img, 0, 0);
|
|
|
|
|
- let data = this.context.getImageData(0, 0, img.width , img.height ).data; //getImageData 1px时 : pc chrome 耗时0.01毫秒左右(排除第一次的50) , 但firefox: 4。但换贴图之后就多达5甚至几十
|
|
|
|
|
- //console.log('changeImg',pano.id )
|
|
|
|
|
- //this.img = img
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- if(this.imgDatas.length >= this.maxDataCount){
|
|
|
|
|
- let old = this.imgDatas.find(e=>!this.nearPanos.includes(e.pano));
|
|
|
|
|
- //console.log('推出',old.pano.id)
|
|
|
|
|
- this.imgDatas.splice(this.imgDatas.indexOf(old), 1);//推出使用时间最早的一个非nearPano
|
|
|
|
|
- }
|
|
|
|
|
- this.imgDatas.push({pano, data});
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- this.dispatchEvent({type:'changeImg',pano});
|
|
|
|
|
- viewer.addTimeMark('depthSampler','end'); //耗时chrome 25ms,firefox: 38ms, iphoneX:33ms
|
|
|
|
|
-
|
|
|
|
|
|
|
+ try{
|
|
|
|
|
+ viewer.addTimeMark('depthSampler','start');
|
|
|
|
|
+ this.canvas.width = img.width;
|
|
|
|
|
+ this.canvas.height = img.height;
|
|
|
|
|
+ this.context.drawImage(img, 0, 0);
|
|
|
|
|
+ let data = this.context.getImageData(0, 0, img.width , img.height ).data; //getImageData 1px时 : pc chrome 耗时0.01毫秒左右(排除第一次的50) , 但firefox: 4。但换贴图之后就多达5甚至几十
|
|
|
|
|
+ //console.log('changeImg',pano.id )
|
|
|
|
|
+ //this.img = img
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if(this.imgDatas.length >= this.maxDataCount){
|
|
|
|
|
+ let old = this.imgDatas.find(e=>!this.nearPanos.includes(e.pano));
|
|
|
|
|
+ //console.log('推出',old.pano.id)
|
|
|
|
|
+ this.imgDatas.splice(this.imgDatas.indexOf(old), 1);//推出使用时间最早的一个非nearPano
|
|
|
|
|
+ }
|
|
|
|
|
+ this.imgDatas.push({pano, data});
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ this.dispatchEvent({type:'changeImg',pano});
|
|
|
|
|
+ viewer.addTimeMark('depthSampler','end'); //耗时chrome 25ms,firefox: 38ms, iphoneX:33ms
|
|
|
|
|
+ }catch(e){
|
|
|
|
|
+ console.error(e ); //内存不足 Failed to execute 'getImageData' on 'CanvasRenderingContext2D': Out of memory at ImageData creation
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
/* pano.depthData = {}
|
|
/* pano.depthData = {}
|
|
@@ -98660,14 +98664,14 @@ ENDSEC
|
|
|
let panos = [this.currentPano, ...nearPanos ];
|
|
let panos = [this.currentPano, ...nearPanos ];
|
|
|
this.depthSampler.updateNearPanos(panos);
|
|
this.depthSampler.updateNearPanos(panos);
|
|
|
|
|
|
|
|
- let maxWaitDur = browser.isMobile() ? 40 : 60;
|
|
|
|
|
- let changeCount = 0, getCount = 0;
|
|
|
|
|
|
|
+ let maxWaitDur = browser.isMobile() ? 30 : 60;
|
|
|
|
|
+ let changeCount = 0, maxChangeTex = browser.isMobile() ? 2 : 4, getCount = 0;
|
|
|
let changeTexCount = ()=>{
|
|
let changeTexCount = ()=>{
|
|
|
changeCount ++;
|
|
changeCount ++;
|
|
|
- };
|
|
|
|
|
|
|
+ };
|
|
|
let median = Math.max(10, Potree.timeCollect.depthSampler.median);
|
|
let median = Math.max(10, Potree.timeCollect.depthSampler.median);
|
|
|
let ifOverTime = ()=>{
|
|
let ifOverTime = ()=>{
|
|
|
- let is = changeCount * median + getCount * 0.01 > maxWaitDur;//不换贴图也要一丢丢计算时间
|
|
|
|
|
|
|
+ let is = changeCount >= maxChangeTex || changeCount * median + getCount * 0.01 > maxWaitDur;//不换贴图也要一丢丢计算时间
|
|
|
/* if(is){
|
|
/* if(is){
|
|
|
console.log(1)
|
|
console.log(1)
|
|
|
} */
|
|
} */
|