Browse Source

Merge branch 'v1.9.0-jm' of http://192.168.0.115:3000/bill/fuse-code into v1.9.0-jm

bill 7 months ago
parent
commit
d4f75c5796
4 changed files with 34 additions and 29 deletions
  1. 7 2
      public/lib/Cesium/Cesium.js
  2. 21 21
      public/lib/potree/potree.js
  3. 1 1
      public/lib/potree/potree.js.map
  4. 5 5
      src/sdk/cover/index.js

File diff suppressed because it is too large
+ 7 - 2
public/lib/Cesium/Cesium.js


+ 21 - 21
public/lib/potree/potree.js

@@ -4655,6 +4655,9 @@
 	          func,
 	          delayTime
 	        };
+	        /* if(name == 'processPriorityQueue'){
+	            console.log('isWaiting', delayTime)
+	        } */
 	        this.list.push(item);
 	        setTimeout(() => {
 	          var a = this.list.indexOf(item);
@@ -22076,9 +22079,9 @@
 	            var locationLonLat = prop.raw.wgs84.split(',').map(e => parseFloat(e));
 	            var location = viewer.transform.lonlatToLocal.forward(locationLonLat);
 	            MergeEditor.moveBoundCenterTo(model, new Vector3().fromArray(location));
-	            MergeEditor.setModelBtmHeight(model, 0); // 离地高度为0 (因为不想在地图下方所以高程不管了,都在地面上即可)
 	            model.hasLonLat = true;
 	          }
+	          MergeEditor.setModelBtmHeight(model, 0); // 离地高度为0 (因为不想在地图下方所以高程不管了,都在地面上即可)
 	        }
 	      }
 	      if (prop.rotation && (prop.rotation.x != 0 || prop.rotation.y != 0 || prop.rotation.z != 0)) {
@@ -22268,7 +22271,10 @@
 	      //else if(prop.type == 'las' || prop.type == 'ply' || prop.type == 'laz' ) 
 	      prop.url instanceof Array && (prop.url = prop.url[0]); //deal bug
 	      Potree.loadPointCloudScene(prop.url, prop.type, prop.modelId, prop.title, pointcloud => {
-	        pointcloud.matrixAutoUpdate = true;
+	        {
+	          pointcloud.matrixAutoUpdate = true;
+	          pointcloud.matrix.decompose(pointcloud.position, pointcloud.quaternion, pointcloud.scale); //将数据集的经纬度和旋转应用到rotation和position (注意position和translateUser并不一样)
+	        }
 	        pointcloud.initialPosition = pointcloud.position.clone();
 	        pointcloud.pos1MatrixInvert = new Matrix4().setPosition(pointcloud.initialPosition).invert();
 	        if (Potree.settings.mergeType2 && pointcloud.datasetData) {
@@ -22908,7 +22914,7 @@
 	  showNeighSetGui: browser.urlHasValue('neighGui'),
 	  selectShowBox: true,
 	  //fastTran: isTest
-	  pathSmooth: false // window.location.href.includes('192.168.0.59')  //true //smooth曲线, 非折线
+	  pathSmooth: true // window.location.href.includes('192.168.0.59')  //true //smooth曲线, 非折线
 	};
 	Potree.config = config$1;
 	Potree.settings = settings;
@@ -42706,14 +42712,8 @@
 	      this.titleLabel.updatePose();
 	    }
 	  }
-
-	  /* let lastIndex = this.points.length - 1
-	  if(add == -1) return (index === 0) ? lastIndex : index - 1;
-	  else if(add == 1)  return (index + 1 > lastIndex) ? 0 : index + 1; 
-	  }
-	     */
 	  getPosByIntersect(e, type) {
-	    //intersect落在线上的位置
+	    //intersect落在线上的位置,以及在哪两个点之间
 
 	    if (!Potree.settings.pathSmooth) {
 	      var prevIndex = Math.floor(e.hoveredElement.faceIndex / 2); //端点1(可能是最后一个)
@@ -42729,7 +42729,7 @@
 	      var prevIndex0 = Math.floor(e.hoveredElement.faceIndex / 2); //所在的mesh片段的端点1
 	      var nextIndex0 = prevIndex0 + 1; //所在的mesh片段的端点2
 
-	      var _point = math.getFootPoint(e.hoveredElement.point, this.geoPoints[prevIndex0], this.geoPoints[nextIndex0]);
+	      var _point = math.getFootPoint(e.hoveredElement.point, this.geoPoints[prevIndex0], this.geoPoints[nextIndex0]); //新点位置
 	      if (type == 'onlyPoint') return {
 	        point: _point
 	      };
@@ -42744,17 +42744,15 @@
 	        }
 	      }
 	      if (_nextIndex == void 0) {
-	        //最后一
+	        //最后一个点 
 	        _nextIndex = count - 1;
 	      }
-	      if (_prevIndex == _nextIndex) {
-	        //端点在相同区间。直接+1
-	        _nextIndex = _prevIndex + 1;
-	      } else {
+	      if (_prevIndex != _nextIndex) {
 	        //端点在不同points区间, 需要判断intersect的究竟在哪个区间
+
 	        //console.log('跨点', prevIndex, nextIndex)
 	        this.geoPoints[_prevIndex];
-	        var lengths = [];
+	        var lengths = []; //geo端点间包含points哪些点
 	        var j = _prevIndex;
 	        var A = this.geoPoints[prevIndex0];
 	        var B = this.geoPoints[nextIndex0];
@@ -42771,9 +42769,8 @@
 	        }
 	        searchIndex == void 0 && (searchIndex = _nextIndex); //最后一个点之后
 	        _prevIndex = searchIndex;
-	        _nextIndex = _prevIndex + 1;
 	      }
-
+	      _nextIndex = _prevIndex + 1;
 	      //console.log(prevIndex, nextIndex)
 	      var _index = _prevIndex + 1; //新点在端点1后
 	      return {
@@ -58289,7 +58286,7 @@
 	          if (Potree.settings.fastTran && viewer.images360.fastTranMaskPass.enabled) {
 	            viewer.images360.fastTranMaskPass.render();
 	          }
-	          return;
+	          if (viewer.objs.children.length == 0 || !params.useModelOnRT) return;
 	        }
 	      }
 	    }
@@ -84876,9 +84873,10 @@
 	          //多折线没有areaPlane 有时候会看向空白区域 - -
 	        }
 	      } else if (Potree.settings.displayMode == 'showPanos') {
+	        var _object$measureType;
 	        //全景 (比较难校准)
 	        var target2, _dir4;
-	        if (object.measureType.includes('MulDistance')) {
+	        if ((_object$measureType = object.measureType) !== null && _object$measureType !== void 0 && _object$measureType.includes('MulDistance')) {
 	          //因为该线不闭合,可能看向target的方向会没有线,所以换一个target
 	          target2 = object.points[Math.round(object.points.length / 2)]; //直接看向中间点
 	          _dir4 = new Vector3().subVectors(target2, position).normalize();
@@ -85014,6 +85012,8 @@
 	      }
 	    } else if (object.boundingBox && type == 'boundingBox') {
 	      //使屏幕刚好看全boundingBox
+	      //object.boundingBox.min.clamp(new THREE.Vector3(-1e4, -1e4, -1e4), new THREE.Vector3(1e4, 1e4, 1e4))//防止过大,ces崩溃
+	      //object.boundingBox.max.clamp(new THREE.Vector3(-1e4, -1e4, -1e4), new THREE.Vector3(1e4, 1e4, 1e4))//防止过大,ces崩溃
 	      target = object.boundingBox.getCenter(new Vector3());
 	      if (o.dir) {
 	        //指定方向

File diff suppressed because it is too large
+ 1 - 1
public/lib/potree/potree.js.map


+ 5 - 5
src/sdk/cover/index.js

@@ -677,7 +677,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
         },
 
 
-        setBackdrop(sky, type, { scale, rotate }) {//天空盒背景
+        setBackdrop(sky, type, { scale, rotate }={}) {//天空盒背景
             //console.log('天空盒背景',  sky,type)
 
             let setGroundAndText = (color) => {
@@ -732,7 +732,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
             map.switchStyle(type )
         }, */
         switchMapType(type){//切换成江门的卫星或标准  
-         
+            if(window.location.href.includes('localhost:7173') ) return
             console.log('switchMapType',type)
             let maximumLevel, url
             if(type == 'satellite'){
@@ -910,7 +910,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                 if (!props.isFirstLoad) {
                     model.visible = false//先不显示,防止卡顿
                 }
-                model.showInPano = props.raw.showInPano
+                model.showInPano = /* !model.is4dkkModel// */props.raw.showInPano  //现在不用这个,所有模型都可见,非is4dkkModel的还显示原本的贴图
                 props.opacity < 100 && result.changeOpacity(props.opacity)
 
                 model.addEventListener('changeSelect', (e) => {
@@ -1925,7 +1925,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                 minimumLevel: 0,
                 maximumLevel: satellite?18:19, 
                 credit: new Cesium.Credit('高德地图'),
-                tilingScheme: new AmapMercatorTilingScheme(),  //修改投影,从84->高德
+                //tilingScheme: new AmapMercatorTilingScheme(),  //修改投影,从84->高德
                 crossOrigin: 'anonymous',
             }) 
             cesiumViewer.imageryLayers.removeAll();
@@ -2029,7 +2029,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                 let height = pos.z;
                 let deg = viewer.transform.lonlatToLocal.inverse(xy)  //  toMap.forward(xy);
                 let cPos = Cesium.Cartesian3.fromDegrees(...deg, height);
-
+                //console.log('toCes',cPos,height) //数字过大如e35会崩溃
                 return cPos;
             };