|
@@ -208,7 +208,7 @@
|
|
|
if(splatId!=''){
|
|
if(splatId!=''){
|
|
|
let path = browser.urlHasValue('gsPath', true)
|
|
let path = browser.urlHasValue('gsPath', true)
|
|
|
if(path){
|
|
if(path){
|
|
|
- path = Potree.Common.replaceAll(path,'{splatId}',splatId)
|
|
|
|
|
|
|
+ path = Potree.Common.replaceAll(path,'+splatId+',splatId)
|
|
|
}else{
|
|
}else{
|
|
|
if(urlAtSplatter){
|
|
if(urlAtSplatter){
|
|
|
path = Potree.resourcePath + '../../../../examples/tomcat/splatter.app/data/' + splatId
|
|
path = Potree.resourcePath + '../../../../examples/tomcat/splatter.app/data/' + splatId
|
|
@@ -234,27 +234,27 @@
|
|
|
|
|
|
|
|
applyConfig(config)
|
|
applyConfig(config)
|
|
|
|
|
|
|
|
- let btn1 = document.querySelector('#potree_render_area [value=">>全景"]')
|
|
|
|
|
|
|
+ let btn1 = document.querySelector('#potree_render_area button[index="1"]')
|
|
|
btn1.style.right = '27%'
|
|
btn1.style.right = '27%'
|
|
|
/*btn1.value = '停lod'
|
|
/*btn1.value = '停lod'
|
|
|
btn1.onclick = ()=>{
|
|
btn1.onclick = ()=>{
|
|
|
btn1.value = btn1.value == '停lod' ? '开lod' : '停lod'
|
|
btn1.value = btn1.value == '停lod' ? '开lod' : '停lod'
|
|
|
viewer.splatter.renderer.lodder.pauseLod = btn1.value == '停lod' ? 0 : 1
|
|
viewer.splatter.renderer.lodder.pauseLod = btn1.value == '停lod' ? 0 : 1
|
|
|
}*/
|
|
}*/
|
|
|
- btn1.value = '停碰撞'
|
|
|
|
|
|
|
+ btn1.innerText = '停碰撞'
|
|
|
btn1.onclick = ()=>{
|
|
btn1.onclick = ()=>{
|
|
|
- btn1.value = btn1.value == '停碰撞' ? '开碰撞' : '停碰撞'
|
|
|
|
|
- window.stopColl = btn1.value == '停碰撞' ? 0 : 1
|
|
|
|
|
|
|
+ btn1.innerText = btn1.innerText == '停碰撞' ? '开碰撞' : '停碰撞'
|
|
|
|
|
+ window.stopColl = btn1.innerText == '停碰撞' ? 0 : 1
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- let btn2 = document.querySelector('#potree_render_area [value="隐藏点云"]')
|
|
|
|
|
|
|
+ let btn2 = document.querySelector('#potree_render_area button[index="0"]')
|
|
|
/*btn2.value = '停sort'
|
|
/*btn2.value = '停sort'
|
|
|
btn2.onclick = ()=>{
|
|
btn2.onclick = ()=>{
|
|
|
btn2.value = btn2.value == '停sort' ? '开sort' : '停sort'
|
|
btn2.value = btn2.value == '停sort' ? '开sort' : '停sort'
|
|
|
viewer.splatter.renderer.lodder.pauseSort = btn2.value == '停sort' ? 0 : 1
|
|
viewer.splatter.renderer.lodder.pauseSort = btn2.value == '停sort' ? 0 : 1
|
|
|
}*/
|
|
}*/
|
|
|
- btn2.value = 'toggleMesh'
|
|
|
|
|
|
|
+ btn2.innerText = 'toggleMesh'
|
|
|
btn2.onclick = ()=>{
|
|
btn2.onclick = ()=>{
|
|
|
viewer.collider.toggleMesh()
|
|
viewer.collider.toggleMesh()
|
|
|
}
|
|
}
|
|
@@ -262,24 +262,39 @@
|
|
|
browser.urlHasValue('character') && viewer.setControls(viewer.characterCtrl)
|
|
browser.urlHasValue('character') && viewer.setControls(viewer.characterCtrl)
|
|
|
|
|
|
|
|
|
|
|
|
|
- let modeBtn = document.createElement('input')
|
|
|
|
|
|
|
+ let modeBtn = document.createElement('button')
|
|
|
btn2.parentElement.appendChild(modeBtn)
|
|
btn2.parentElement.appendChild(modeBtn)
|
|
|
modeBtn.style.width = '60px'
|
|
modeBtn.style.width = '60px'
|
|
|
modeBtn.style.right = '5px'
|
|
modeBtn.style.right = '5px'
|
|
|
modeBtn.style.top = '5px'
|
|
modeBtn.style.top = '5px'
|
|
|
modeBtn.style['z-index'] = 10000;
|
|
modeBtn.style['z-index'] = 10000;
|
|
|
modeBtn.style['position'] = 'absolute';
|
|
modeBtn.style['position'] = 'absolute';
|
|
|
- modeBtn.value = '枢轴模式'
|
|
|
|
|
|
|
+ modeBtn.innerText = '枢轴模式'
|
|
|
let firstControl = viewer.controls
|
|
let firstControl = viewer.controls
|
|
|
viewer.orbitControls.constantlyForward = true
|
|
viewer.orbitControls.constantlyForward = true
|
|
|
viewer.orbitControls.progression = true
|
|
viewer.orbitControls.progression = true
|
|
|
- modeBtn.onclick = ()=>{
|
|
|
|
|
- modeBtn.value = modeBtn.value == '枢轴模式' ? '第一人称' : '枢轴模式'
|
|
|
|
|
- viewer.setControls(modeBtn.value == '枢轴模式' ? firstControl : viewer.orbitControls)
|
|
|
|
|
|
|
+ let cur = 0
|
|
|
|
|
+ let modes = [
|
|
|
|
|
+ {name:'第一人称', control: viewer.fpControls},
|
|
|
|
|
+ {name:'枢轴模式', control: viewer.orbitControls},
|
|
|
|
|
+ {name:'数字人', control: viewer.characterCtrl},
|
|
|
|
|
+ ]
|
|
|
|
|
+
|
|
|
|
|
+ let setMode = (num)=>{
|
|
|
|
|
+ cur = num
|
|
|
|
|
+ viewer.setControls(modes[num].control)
|
|
|
|
|
+ modeBtn.innerText = modes[num].name
|
|
|
viewer.mainViewport.view.radius = 10 //for orbit
|
|
viewer.mainViewport.view.radius = 10 //for orbit
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ modeBtn.onclick = ()=>{
|
|
|
|
|
+ cur ++
|
|
|
|
|
+ cur %= modes.length
|
|
|
|
|
+ setMode(cur)
|
|
|
|
|
+ }
|
|
|
|
|
+ browser.urlHasValue('character') && setMode(2)//viewer.setControls(viewer.characterCtrl)
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|