浏览代码

fix: 1111

xzw 7 月之前
父节点
当前提交
bf221d91d6
共有 3 个文件被更改,包括 45 次插入47 次删除
  1. 28 37
      public/lib/potree/potree.js
  2. 1 1
      public/lib/potree/potree.js.map
  3. 16 9
      src/sdk/cover/index.js

+ 28 - 37
public/lib/potree/potree.js

@@ -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++;

文件差异内容过多而无法显示
+ 1 - 1
public/lib/potree/potree.js.map


+ 16 - 9
src/sdk/cover/index.js

@@ -442,7 +442,8 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                 Potree.Utils.updateVisible(measure, 'inListByUser', false)
             },
             fly() {
-                 
+                if(measure.type == 'Path') Potree.settings.displayMode = 'showPointCloud'
+                
                 let result = viewer.focusOnObject(measure, 'measure', 1200, {dontLookUp:measure.type == 'Path'})
  
                 return result.msg ? result.msg : result.promise
@@ -659,18 +660,24 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                 }
             }
             
-            //o.requestShowPano = true
+             o.isFlyToTag = true
             if (o.distance || o.maxDis) {
+                let requestShowPano
                 let position = o.target || o.position
-                if(o.requestShowPano && Potree.settings.displayMode == 'showPointCloud'){
-                    let r = sdk.canTurnToPanoMode(position, o.maxDis)//热点新需求:如果附近有漫游点就飞到全景模式
-                    if(!r){
-                        o.requestShowPano = false
+                if(o.isFlyToTag){
+                    let r = sdk.canTurnToPanoMode(position, 5)//热点新需求:如果附近有漫游点就飞到全景模式
+                    if(r){
+                        requestShowPano = true
+                    }else{
+                        Potree.settings.displayMode = 'showPointCloud'  
                     }
                 }
-                let rusult = viewer.focusOnObject({ position }, 'tag', null, { distance: o.distance,  maxDis : o.maxDis, requestShowPano: o.requestShowPano/* , checkIntersect:true */ })
-                o.requestShowPano && rusult.promise.then(()=>{
-                    Potree.settings.displayMode = 'showPanos'
+                let rusult = viewer.focusOnObject({ position }, 'tag', null, { distance: o.distance || 1,  maxDis : o.maxDis, requestShowPano   /* , checkIntersect:true */  })
+                rusult.promise.then(()=>{
+                    if(o.isFlyToTag){
+                        Potree.settings.displayMode = requestShowPano ? 'showPanos' : 'showPointCloud' 
+                    }
+                    
                 })
                 return rusult.promise