xzw 1 年之前
父節點
當前提交
656aef3821
共有 3 個文件被更改,包括 27 次插入12 次删除
  1. 21 8
      public/lib/potree/potree.js
  2. 1 1
      public/lib/potree/potree.js.map
  3. 5 3
      src/sdk/cover/index.js

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

@@ -120891,16 +120891,32 @@ ENDSEC
 	    },
 	    
 	    
-	    setGroundPlaneImg(src){//设置地面图
-	        const s = 0.06;
+	    setGroundPlaneImg(src,scale){//设置地面图
+	        
+	        this.goundScale = scale;
+	        let oldSrc = this.curGroundImgSrc;
 	        this.curGroundImgSrc = src;
+	        const ratio = 0.04;
+	        
+	        
 	        if(src){
+	            if(oldSrc == src && this.groundPlane.material.map.image){ //仅修改大小
+	                const s = ratio * this.goundScale;
+	                let {width, height} = this.groundPlane.material.map.image;
+	                this.groundPlane.scale.set(width*s, height*s);  
+	                viewer.dispatchEvent('content_changed');
+	                
+	                return
+	            }
+	            
 	            let map = texLoader$a.load(src,(tex)=>{
 	                if(this.curGroundImgSrc == src){
+	                    const s = ratio * this.goundScale;
 	                    this.groundPlane.scale.set(tex.image.width*s, tex.image.height*s);  
 	                    viewer.dispatchEvent('content_changed');
-	                }
-	            }); 
+	                } 
+	            });
+	            Potree.Utils.makeTexDontResize(map);          
 	            if(!this.groundPlane){
 	                this.groundPlane = new Mesh(new PlaneBufferGeometry(1,1,1), new MeshBasicMaterial({
 	                    map,  
@@ -120916,10 +120932,7 @@ ENDSEC
 	            Potree.Utils.updateVisible(this.groundPlane,'show',true );
 	        }else {
 	            this.groundPlane && Potree.Utils.updateVisible(this.groundPlane,'show',false );
-	        } 
-	        
-	        
-	        
+	        }  
 	    }
 	    
 	};   

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


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

@@ -320,7 +320,9 @@ export const enter = (dom, mapDom, isLocal, lonlat) => {
             return Potree.Utils.getPos2d(worldPos, viewport, dom  )
         },
         
-        
+        setCameraFov(fov){
+            viewer.setFOV(fov)
+        },
          
         
         screenshot: (width, height, bgOpacity=1) => {
@@ -368,7 +370,7 @@ export const enter = (dom, mapDom, isLocal, lonlat) => {
         },
          
  
-        setBackdrop(sky, type){//天空盒背景
+        setBackdrop(sky, type, scale ){//天空盒背景
             console.log('天空盒背景',  sky,type)
             
             let setGroundAndText = (color)=>{
@@ -380,7 +382,7 @@ export const enter = (dom, mapDom, isLocal, lonlat) => {
             
             
             if(type == 'bimg' ){//地面图 
-                MergeEditor.setGroundPlaneImg(sky) 
+                MergeEditor.setGroundPlaneImg(sky, scale) 
                 setGroundAndText('#e0e0e0')
                 viewer.setBackground(mainBackground) 
             }else{