|
@@ -128,12 +128,8 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
|| Potree.settings.editType == 'merge' && !e.intersectPoint || viewer.inputHandler.hoveredElements[0] && viewer.inputHandler.hoveredElements[0].isModel && e.intersectPoint.distance > viewer.inputHandler.hoveredElements[0].distance
|
|
|
) return
|
|
|
|
|
|
- if(Potree.settings.editType != 'pano' && Potree.settings.editType != 'merge'){
|
|
|
- if( e.hoverViewport == viewer.mapViewer.viewports[0]){
|
|
|
- return viewer.mapViewer.dispatchEvent(e/* {type:'global_click',e } */)
|
|
|
- }else if(e.hoverViewport != viewer.mainViewport){ //如数据集校准其他viewport
|
|
|
- return
|
|
|
- }
|
|
|
+ if(e.hoverViewport != viewer.mainViewport){ //如数据集校准其他viewport
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
if(!Potree.settings.dblToFocusPoint/* && this.currentPano */){//双击不会focus点云 或者 已经focusPano了
|
|
@@ -282,14 +278,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
this.addEventListener('flyToPanoDone',wait) //等待飞行完毕。flyToPano的callback可能不执行所以换这个。但也可能被cancel
|
|
|
this.flyToPano({
|
|
|
pano: this.findNearestPano(),
|
|
|
- //dealDoneWhenCancel:true,
|
|
|
- /* callback: ()=>{
|
|
|
- setTimeout(()=>{ //防止循环,所以延迟
|
|
|
- if(this.latestRequestMode == mode ){
|
|
|
- Potree.settings.displayMode = mode
|
|
|
- }
|
|
|
- },1)
|
|
|
- } */
|
|
|
+
|
|
|
})
|
|
|
|
|
|
return;
|
|
@@ -318,9 +307,9 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
return
|
|
|
} */
|
|
|
if(!this.currentPano.skyboxTex){
|
|
|
- pano.waitForLoad()
|
|
|
- this.addEventListener('loadedTex', wait, {once:true})
|
|
|
- this.currentPano.loadTex()
|
|
|
+ this.currentPano.waitForLoad()
|
|
|
+ this.currentPano.addEventListener('loadedTex', wait, {once:true})
|
|
|
+ return this.currentPano.loadTex()
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -692,7 +681,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
if(!pano.skyboxTex){
|
|
|
pano.waitForLoad()
|
|
|
pano.addEventListener('loadedTex', wait, {once:true})
|
|
|
- pano.loadTex()
|
|
|
+ return pano.loadTex()
|
|
|
}
|
|
|
/* if(this.checkAndWaitForPanoLoad(pano, toPano.basePanoSize || this.basePanoSize, wait )){
|
|
|
return
|
|
@@ -1046,19 +1035,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
t || (t = 0);
|
|
|
option1 = void 0 !== option1 ? option1 : .75;
|
|
|
var o = option2 ? "angle" : "direction";
|
|
|
-
|
|
|
- var floor = viewer.modules.SiteModel.currentFloor;
|
|
|
- var entity = viewer.modules.SiteModel.inEntity;
|
|
|
-
|
|
|
- var getHeightDis = (pano)=>{
|
|
|
- if(floor && !floor.panos.includes(pano) && pano.position.z < this.position.z){ //若是上方的漫游点,就正常走。因为一般不会点击天花板。
|
|
|
- return this.position.z - pano.position.z
|
|
|
- }else{
|
|
|
- return 0
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
let disSquareMap = new Map()
|
|
|
this.panos.forEach(pano=>{
|
|
|
let dis2 = pano.position.distanceToSquared(this.position); //距离目标点
|
|
@@ -1402,7 +1379,17 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+ getIntersect(pano, dir, origin){
|
|
|
+ if(pano && pano.pointcloud.hasDepthTex ){
|
|
|
+ return this.depthSampler.sample( {dir }, pano, true )
|
|
|
+ }else{
|
|
|
+ origin = origin || pano.position
|
|
|
+ return viewer.inputHandler.getIntersect(viewer.inputHandler.hoverViewport, true, null, null, true, {
|
|
|
+ point: origin.clone().add(dir),
|
|
|
+ cameraPos: origin
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
@@ -1811,41 +1798,7 @@ Images360.prototype.updateCube = (function(){//增加细分的版本,且垂直
|
|
|
if(maxZ == Infinity) maxZ = skyHeight; //maxZ = Math.max(skyHeight, maxZ)
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- /* if(pano.ceilZ != void 0){
|
|
|
- maxZ = pano.ceilZ
|
|
|
- }else{//天花板高度值
|
|
|
- //用三个间隔120度散开,和中心垂直线成一定夹角的三个向量去求 最高高度 (不求平均的原因:万一是0不好算)
|
|
|
- let rotMat = new THREE.Matrix4().makeRotationX(THREE.Math.degToRad(40))// 角度不能小于天花板中空的半径,大概就是0.2*Math.PI=36度
|
|
|
-
|
|
|
- let dirs = [new THREE.Vector3(0,0,1).applyMatrix4(rotMat)];
|
|
|
- if(depthTiming < 1){
|
|
|
- let rotMat1 = new THREE.Matrix4().makeRotationZ(Math.PI*2 / 3);
|
|
|
- dirs.push(dirs[0].clone().applyMatrix4(rotMat1))
|
|
|
- }
|
|
|
- if(depthTiming < 0.3){
|
|
|
- let rotMat2 = new THREE.Matrix4().makeRotationZ(-Math.PI*2 / 3);
|
|
|
- dirs.push(dirs[0].clone().applyMatrix4(rotMat2));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- let skyHeight = 50
|
|
|
- let zs = dirs.map(dir_=>{
|
|
|
- let intersect = this.getIntersect(pano, dir_)
|
|
|
- let z = intersect ? intersect.location.z : pano.position.z+skyHeight //没有intersect代表可能是天空
|
|
|
- return z
|
|
|
- })
|
|
|
- zs.sort((a,b)=>{return b-a});//得最大值 (不用中位数的原因:在屋檐处,如果仅有一个intersect是天空,因到了室外所以也用天空高度)
|
|
|
- maxZ = zs[0]
|
|
|
|
|
|
- let min = pano.position.z + 1 // 防止意外太低
|
|
|
- maxZ = Math.max(min,maxZ)
|
|
|
- pano.ceilZ = maxZ
|
|
|
-
|
|
|
- } */
|
|
|
- //console.log(pano.id, 'maxZ:',maxZ )
|
|
|
- //console.log(pano.id, 'minZ:',minZ )
|
|
|
[maxZ, minZ ].forEach(z=>{
|
|
|
posArr.push(pano.position.clone().setZ(z))
|
|
|
})
|