Browse Source

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

bill 8 months ago
parent
commit
3e95e8b0ff
3 changed files with 26 additions and 23 deletions
  1. 21 12
      public/lib/potree/potree.js
  2. 1 1
      public/lib/potree/potree.js.map
  3. 4 10
      src/sdk/cover/index.js

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

@@ -55607,11 +55607,11 @@
 	var texLoader$7 = new TextureLoader();
 	var lineMat;
 	var defaultLineLength = 1;
-	var defaultSpotScale = 0.4;
+	var defaultSpotScale = 0.35;
 	var titleHeight = {
-	  uponSpot: 0.1,
-	  uponLine: 0
-	};
+	  uponSpot: 0.1
+	}; //title底部和spot顶端间隔
+
 	var Vectors$2 = {
 	  UP: new Vector3(0, 1, 0),
 	  ZERO: new Vector3()
@@ -55815,7 +55815,7 @@
 	  setTitle() {
 	    var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
 	    this.titleLabel.setText(title);
-	    this.setTitleVisi(title.trim() != '', 'noText');
+	    this.setTitleVisi(title instanceof Array || title.trim() != '', 'noText');
 	    viewer.dispatchEvent('content_changed');
 	  }
 	  setTitleVisi(v) {
@@ -55825,6 +55825,21 @@
 	    //line的可见性比较复杂,所以干脆跟随title的,reason不记录那么多
 	    this.onMesh && Potree.Utils.updateVisible(this.line, 'hideTitle', this.titleLabel.visible);
 	  }
+	  setFontSize(fontsize) {
+	    this.titleLabel.fontsize = this.fontsize = fontsize;
+	    this.titleLabel.updateTexture();
+	    this.updateTitlePos();
+	    viewer.dispatchEvent('content_changed');
+	  }
+	  changeSpotScale(s) {
+	    s *= defaultSpotScale;
+	    this.spot.scale.set(s, s, s);
+	    this.updateTitlePos();
+	    viewer.dispatchEvent('content_changed');
+	  }
+	  updateTitlePos() {
+	    this.onMesh || (this.titleLabel.position.y = titleHeight.uponSpot + (this.spot.scale.x + this.titleLabel.sprite.scale.y) / 2);
+	  }
 	  changeMap(url) {
 	    var map = texLoader$7.load(url, () => {
 	      viewer.dispatchEvent('content_changed');
@@ -55842,13 +55857,6 @@
 	    this.faceAngle = faceAngle;
 	    viewer.dispatchEvent('content_changed');
 	  }
-	  changeSpotScale(s) {
-	    this.spot.scale.set(s, s, s);
-	    viewer.dispatchEvent('content_changed');
-	  }
-	  updateTitlePos() {
-	    this.onMesh || (this.titleLabel.position.y = titleHeight.uponSpot + this.spot.scale.x);
-	  }
 	  setNorQua() {
 	    if (!this.onMesh) return;
 	    this.spot.quaternion.setFromRotationMatrix(new Matrix4().lookAt(this.normal, Vectors$2.ZERO, Vectors$2.UP));
@@ -55889,6 +55897,7 @@
 	    var _this$titleLabel;
 	    this.parent.remove(this);
 	    (_this$titleLabel = this.titleLabel) === null || _this$titleLabel === void 0 || _this$titleLabel.dispose();
+	    viewer.dispatchEvent('content_changed');
 	  }
 	}
 

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


+ 4 - 10
src/sdk/cover/index.js

@@ -450,7 +450,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes }) => {
 
 
 
-             console.log('getScreenByPoint ' + pos3d.toArray())
+            //console.log('getScreenByPoint ' + pos3d.toArray())
             return Potree.Utils.getPos2d(worldPos, viewport, dom)
         },
 
@@ -1361,18 +1361,12 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes }) => {
                     tag.changeSpotScale(scale)
                 },
                 changeFontSize(fontsize){
-                    tag.titleLabel.fontsize = fontsize
-                    tag.titleLabel.updateTexture();
-                    viewer.dispatchEvent('content_changed')
+                    tag.setFontSize(fontsize)
                 },
                 // 更改离地高度
                 changeLineHeight(height){//线长
                     tag.changeLineLen(height)
-                },
-                changeAltitudeAboveGround(height){//线长
-                    console.warn('changeAltitudeAboveGround 删除了')
-                    tag.changeLineLen(height || 1)
-                },
+                }, 
                 changeCanMove(canMove){
                     tag.dragEnable = canMove
                 },
@@ -1396,7 +1390,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes }) => {
                     }
                 }, */
                 getCameraDisSquared(){//距离intersect的位置
-                    return viewer.mainViewport.camera.position.distanceToSquared(tag.position) /* < tag.farSquared */
+                    return viewer.mainViewport.camera.position.distanceToSquared(tag.getWorldPosition()) /* < tag.farSquared */
                 }, 
                 destory(){
                     tag.dispose()