|
|
@@ -29,7 +29,7 @@ let texLoader = new THREE.TextureLoader()
|
|
|
let lineMat, dragPointMat
|
|
|
|
|
|
const defaultLineLength = 1
|
|
|
-const defaultSpotScale = 0.35
|
|
|
+const SpotScale = 0.37
|
|
|
|
|
|
const titleHeight = {uponSpot:0.1 }//title底部和spot顶端间隔
|
|
|
|
|
|
@@ -51,12 +51,11 @@ class Tag extends THREE.Shim.FollowRootObject{
|
|
|
this.lineLength = o.lineLength != void 0 ? o.lineLength : defaultLineLength
|
|
|
this.position.copy(o.position)
|
|
|
this.normal = o.normal != void 0 ? o.normal : new THREE.Vector3(0,0, 1)
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
this.build(o)
|
|
|
this.bindEvent()
|
|
|
this.dragEnable = true
|
|
|
-
|
|
|
+ this.changeSpotScale(1) //init
|
|
|
}
|
|
|
|
|
|
set dragEnable(state){
|
|
|
@@ -79,7 +78,7 @@ class Tag extends THREE.Shim.FollowRootObject{
|
|
|
transparent:true,
|
|
|
})))
|
|
|
this.spot.name = 'spot'
|
|
|
- this.spot.scale.set(defaultSpotScale,defaultSpotScale,defaultSpotScale)
|
|
|
+ this.spot.scale.set(SpotScale,SpotScale,SpotScale)
|
|
|
this.spot.renderOrder = this.spot.pickOrder = Potree.config.renderOrders.tag.spot;
|
|
|
Potree.settings.isOfficial || this.changeMap(Potree.resourcePath+'/textures/spot_default.png')
|
|
|
|
|
|
@@ -322,7 +321,7 @@ class Tag extends THREE.Shim.FollowRootObject{
|
|
|
this.titleLabel.position.y = 0
|
|
|
this.setNorQua()
|
|
|
this.spot.renderOrder = Potree.config.renderOrders.tag.onMesh.spot // 防止遮住线
|
|
|
- this.line.renderOrder = Potree.config.renderOrders.tag.onMesh.line
|
|
|
+ this.line.renderOrder = Potree.config.renderOrders.tag.onMesh.line
|
|
|
}else{
|
|
|
this.titleLabel.parent.add(this.spot)
|
|
|
this.updateTitlePos()
|
|
|
@@ -330,8 +329,9 @@ class Tag extends THREE.Shim.FollowRootObject{
|
|
|
this.spot.quaternion.set(0,0,0,1)//this.titleLabel.waitUpdate()
|
|
|
this.realFaceAngle = 0
|
|
|
this.spot.renderOrder = Potree.config.renderOrders.tag.spot //还原
|
|
|
- this.line.renderOrder = Potree.config.renderOrders.tag.line
|
|
|
+ this.line.renderOrder = Potree.config.renderOrders.tag.line
|
|
|
}
|
|
|
+ this.changeSpotScale()
|
|
|
Potree.Utils.updateVisible(this.line,'hideTitle', !this.titleLabel.visible && onMesh ? false : true)
|
|
|
this.updateDepthParams()
|
|
|
viewer.dispatchEvent('content_changed')
|
|
|
@@ -394,10 +394,13 @@ class Tag extends THREE.Shim.FollowRootObject{
|
|
|
viewer.dispatchEvent('content_changed')
|
|
|
}
|
|
|
|
|
|
- changeSpotScale(s){
|
|
|
- s *= defaultSpotScale
|
|
|
+ changeSpotScale(s = this.spotScaleRatio){
|
|
|
+ this.spotScaleRatio = s
|
|
|
+ s *= SpotScale
|
|
|
+ this.onMesh && (s *= 0.3) //反馈过贴地变很大,只好调一下
|
|
|
this.spot.scale.set(s,s,s)
|
|
|
this.updateTitlePos()
|
|
|
+
|
|
|
viewer.dispatchEvent('content_changed')
|
|
|
}
|
|
|
|