|
@@ -768,12 +768,12 @@ let MergeEditor = {
|
|
|
},
|
|
|
|
|
|
|
|
|
- setGroundPlaneImg(src,scale){//设置地面图
|
|
|
+ setGroundPlaneImg(src,scale,angle){//设置地面图
|
|
|
|
|
|
- this.goundScale = scale
|
|
|
+ this.goundScale = scale || 1, this.goundAngle = angle || 0
|
|
|
let oldSrc = this.curGroundImgSrc
|
|
|
this.curGroundImgSrc = src
|
|
|
- const ratio = 0.04
|
|
|
+ const ratio = 0.03
|
|
|
|
|
|
|
|
|
if(src){
|
|
@@ -782,14 +782,15 @@ let MergeEditor = {
|
|
|
let {width, height} = this.groundPlane.material.map.image
|
|
|
this.groundPlane.scale.set(width*s, height*s)
|
|
|
viewer.dispatchEvent('content_changed')
|
|
|
-
|
|
|
+ this.groundPlane.rotation.z = THREE.Math.degToRad(this.goundAngle)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
let map = texLoader.load(src,(tex)=>{
|
|
|
if(this.curGroundImgSrc == src){
|
|
|
const s = ratio * this.goundScale
|
|
|
- this.groundPlane.scale.set(tex.image.width*s, tex.image.height*s)
|
|
|
+ this.groundPlane.scale.set(tex.image.width*s, tex.image.height*s)
|
|
|
+ this.groundPlane.rotation.z = THREE.Math.degToRad(this.goundAngle)
|
|
|
viewer.dispatchEvent('content_changed')
|
|
|
}
|
|
|
})
|