|
@@ -9,9 +9,13 @@ export const enter = (dom, isLocal) => {
|
|
|
//Potree.fileServer = axios
|
|
|
Potree.settings.libsUrl = '../lib/'
|
|
|
|
|
|
- const tagLimitDis = 8;
|
|
|
-
|
|
|
+ Potree.settings.notAdditiveBlending = true
|
|
|
|
|
|
+ const tagLimitDis = 8;
|
|
|
+
|
|
|
+ Potree.settings.showCompass = true
|
|
|
+ Potree.settings.compassDom = dom.querySelector('#direction')
|
|
|
+ Potree.settings.maintainBtmZ = true //有离地高度,需要维持不变
|
|
|
|
|
|
let {THREE} = Potree.mergeEditStart(dom)
|
|
|
let MergeEditor = viewer.modules.MergeEditor
|
|
@@ -481,6 +485,7 @@ export const enter = (dom, isLocal) => {
|
|
|
let result = {
|
|
|
bus,
|
|
|
changeShow(show){
|
|
|
+ props.show = show //for autoLoads show model
|
|
|
if(model){
|
|
|
viewer.updateVisible(model, 'changeShow', show)
|
|
|
}
|
|
@@ -498,23 +503,57 @@ export const enter = (dom, isLocal) => {
|
|
|
if(model){
|
|
|
s /= 100
|
|
|
model.scale.set(s,s,s)
|
|
|
+ model.isPointcloud && model.changePointSize(Potree.config.material.realPointSize * s)
|
|
|
model.dispatchEvent("scale_changed")
|
|
|
}
|
|
|
},
|
|
|
- changeOpacity(opacity){
|
|
|
+ changeOpacity(opacity){ //见笔记:透明物体的材质设置
|
|
|
if(opacity == void 0)opacity = 100
|
|
|
opacity/=100
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
if(model){
|
|
|
- if(model.isPointcloud){
|
|
|
- model.material.opacity = opacity
|
|
|
+ if(model.isPointcloud){
|
|
|
+ model.changePointOpacity(opacity)
|
|
|
+ //MergeEditor.updateEdgeStrength()
|
|
|
}else{
|
|
|
- model.traverse(e=>e.material && (e.material.opacity = opacity))
|
|
|
+ //model.traverse(e=>e.material && setOp(e, opacity))
|
|
|
+ model.traverse(mesh=>{
|
|
|
+ if(mesh.material){
|
|
|
+
|
|
|
+ mesh.material.opacity = opacity
|
|
|
+ if(opacity<1){
|
|
|
+ mesh.material.transparent = true
|
|
|
+ if(model.isPointcloud){
|
|
|
+ mesh.changePointOpacity(opacity)
|
|
|
+ }else{
|
|
|
+ mesh.material.opacity = opacity
|
|
|
+ }
|
|
|
+
|
|
|
+ mesh.renderOrder = Potree.config.renderOrders.model+1
|
|
|
+ mesh.material.depthWrite = false
|
|
|
+ }else{
|
|
|
+ mesh.material.transparent = false
|
|
|
+ mesh.renderOrder = Potree.config.renderOrders.model
|
|
|
+ mesh.material.depthWrite = true
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ model.opacity = opacity//记录在最外层
|
|
|
}
|
|
|
|
|
|
},
|
|
|
changeBottom(z){
|
|
|
model && MergeEditor.setModelBtmHeight(model,z)
|
|
|
+ model.dispatchEvent('transformChanged') //改了position */
|
|
|
},
|
|
|
enterRotateMode(){
|
|
|
if(model){
|
|
@@ -562,7 +601,7 @@ export const enter = (dom, isLocal) => {
|
|
|
}
|
|
|
|
|
|
|
|
|
- console.log('版本: 2022.8.23-0')
|
|
|
+ console.log('版本: 2022.9.27-0')
|
|
|
|
|
|
return sdk
|
|
|
}
|