|
@@ -32210,39 +32210,24 @@
|
|
|
}
|
|
|
|
|
|
//注:热点最好加上法线信息,这样可以多加一个限制,尽量顺着热点像展示的方向。
|
|
|
- }, pano => {
|
|
|
- var score = 0;
|
|
|
- if (pano.depthTex && checkIntersect) {
|
|
|
- var intersect = !!viewer.ifPointBlockedByIntersect(target, pano.id, true); //viewer.inputHandler.ifBlockedByIntersect({point:target, margin:0.1, cameraPos:pano})
|
|
|
- if (intersect) {
|
|
|
- score = 0;
|
|
|
- } else {
|
|
|
- score = base * 2;
|
|
|
+ }
|
|
|
+ /* (pano)=>{
|
|
|
+ let score = 0
|
|
|
+ if(pano.depthTex && checkIntersect){
|
|
|
+ let intersect = !!viewer.ifPointBlockedByIntersect(target, pano.id, true) //viewer.inputHandler.ifBlockedByIntersect({point:target, margin:0.1, cameraPos:pano})
|
|
|
+ if(intersect){
|
|
|
+ score = 0
|
|
|
+ }else {
|
|
|
+ score = base * 2
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ score = base * 1.5 //没加载好的话,不管了 , 几乎当做无遮挡,否则容易到不了最近点
|
|
|
}
|
|
|
- } else {
|
|
|
- score = base * 1.5; //没加载好的话,不管了 , 几乎当做无遮挡,否则容易到不了最近点
|
|
|
- }
|
|
|
- return score;
|
|
|
- });
|
|
|
+ return score
|
|
|
+ } */);
|
|
|
var g = Common.sortByScore(panos, require, rank);
|
|
|
// console.log(g)
|
|
|
|
|
|
- /* let result1 = g && g.slice(0, 10)
|
|
|
- if(result1){
|
|
|
- g = Common.sortByScore(result1, [], [(e)=>{//避免遮挡
|
|
|
- let pano = e.item;
|
|
|
- let score = 0, log = ''
|
|
|
-
|
|
|
- if(atFloor && atFloor.panos.includes(pano)){//如果不在任何一楼呢?
|
|
|
- score += 600, log+='atFloor'
|
|
|
- }
|
|
|
- return {score, log}
|
|
|
- }]);
|
|
|
- if(g){
|
|
|
- g.forEach(e=>{e.item = e.item.item})
|
|
|
- }
|
|
|
- console.log(g)
|
|
|
- } */
|
|
|
var pano = g && g.length > 0 && g[0].item;
|
|
|
if (pano && checkIntersect) {
|
|
|
var intersect = !!viewer.ifPointBlockedByIntersect(target, pano.id, true);
|
|
@@ -81711,27 +81696,29 @@
|
|
|
for (var i = len - 1; i >= 0; i--) {
|
|
|
var history = shelterHistory[i];
|
|
|
if (history.waitCompute) {
|
|
|
- if (history.waitCompute.panoId != void 0) {
|
|
|
- if (!history.waitCompute.forceGet && (history.waitCompute.panoId != this.images360.currentPano.id || !this.images360.isAtPano(0.1))) {
|
|
|
+ var panoId = history.waitCompute.panoId;
|
|
|
+ if (panoId != void 0) {
|
|
|
+ var _this$images360$curre;
|
|
|
+ if (!history.waitCompute.forceGet && (panoId != ((_this$images360$curre = this.images360.currentPano) === null || _this$images360$curre === void 0 ? void 0 : _this$images360$curre.id) || !this.images360.isAtPano(0.1))) {
|
|
|
delete history.waitCompute; //取消计算
|
|
|
} else {
|
|
|
- var _this$images360$curre;
|
|
|
- if ((_this$images360$curre = this.images360.currentPano) !== null && _this$images360$curre !== void 0 && _this$images360$curre.depthTex) {
|
|
|
+ var pano = this.images360.getPano(panoId);
|
|
|
+ if (pano.depthTex) {
|
|
|
if (byTex >= maxTexCount) break;
|
|
|
byTex++;
|
|
|
var ifShelter = !!viewer.inputHandler.ifBlockedByIntersect({
|
|
|
point: history.point,
|
|
|
+ pano,
|
|
|
margin: Potree.config.shelterMargin,
|
|
|
useDepthTex: true,
|
|
|
viewport: this.mainViewport
|
|
|
});
|
|
|
- history.panos[this.images360.currentPano.id] = ifShelter;
|
|
|
+ history.panos[panoId] = ifShelter;
|
|
|
history.ifShelter = ifShelter;
|
|
|
delete history.waitCompute;
|
|
|
//console.log('补1', history.point.toArray())
|
|
|
} else {
|
|
|
- var _this$images360$curre2;
|
|
|
- if ((_this$images360$curre2 = this.images360.currentPano) !== null && _this$images360$curre2 !== void 0 && _this$images360$curre2.pointcloud.hasDepthTex) {
|
|
|
+ if (pano.pointcloud.hasDepthTex) {
|
|
|
//先等待加载完深度图
|
|
|
} else {
|
|
|
waitCloud.push(history);
|
|
@@ -81771,9 +81758,13 @@
|
|
|
//list.length>0 && console.log('list',list, maxCloudCount)
|
|
|
|
|
|
result.list.forEach(e => {
|
|
|
+ var _this$images360$curre2;
|
|
|
var history = waitCloud2.find(a => a.point.equals(e));
|
|
|
+ var panoId = history.waitCompute.panoId;
|
|
|
+ var cameraPos = panoId != void 0 && panoId != ((_this$images360$curre2 = this.images360.currentPano) === null || _this$images360$curre2 === void 0 ? void 0 : _this$images360$curre2.id) && this.images360.getPano(panoId).position; //如果非当前点,需要改相机位置
|
|
|
var ifShelter = !!viewer.inputHandler.ifBlockedByIntersect({
|
|
|
point: history.point,
|
|
|
+ cameraPos,
|
|
|
margin: Potree.config.shelterMargin,
|
|
|
pickWindowSize: 3,
|
|
|
viewport: this.mainViewport
|
|
@@ -81784,7 +81775,7 @@
|
|
|
ifShelter
|
|
|
};
|
|
|
} else {
|
|
|
- history.panos[this.images360.currentPano.id] = ifShelter;
|
|
|
+ history.panos[panoId] = ifShelter;
|
|
|
}
|
|
|
history.ifShelter = ifShelter;
|
|
|
byCloud++;
|