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