|
@@ -407,7 +407,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
viewer.scene.pointclouds.forEach(e=>{
|
|
|
e.material.pointSizeType = 'FIXED'
|
|
|
})
|
|
|
- }
|
|
|
+ }
|
|
|
this.updateCube(this.currentPano)
|
|
|
|
|
|
}else{
|
|
@@ -1157,7 +1157,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
|
|
|
|
|
|
|
|
|
- isNeighbour(pano0, pano1, dontCompute, onlyUseTex, computeDirFirst){//是否之间没有遮挡(在加载visibles之前,自己算) 最好pano0是currentPano
|
|
|
+ isNeighbour(pano0, pano1, {dontCompute, onlyUseTex, computeDirFirst, computeTwoDir}={}){//是否之间没有遮挡(在加载visibles之前,自己算) 最好pano0是currentPano
|
|
|
|
|
|
if(!pano0 || !pano1 )return
|
|
|
|
|
@@ -1202,7 +1202,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if( map0[pano1.id] == void 0 && !ifNeighbour ) {//主方向为空且不为邻居
|
|
|
+ if(!ifNeighbour && (map0[pano1.id] == void 0 || (computeTwoDir && map1[pano0.id] == void 0))) {//主方向为空且不为邻居
|
|
|
let simpleJudge = pano0.position.distanceToSquared(pano1.position) > 300 //在远处去掉对floorPosition的判断
|
|
|
if(pano0.depthTex || pano1.depthTex){
|
|
|
|
|
@@ -1216,7 +1216,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
map0[pano1.id] = !!is
|
|
|
}
|
|
|
|
|
|
- if( ifNeighbour == void 0 && /* map1[pano0.id] == void 0 && */ pano1.depthTex){ //若正向为false,反向暂且不算,等到pano0为主时再算
|
|
|
+ if(map1[pano0.id] == void 0 && pano1.depthTex){
|
|
|
let is = getNeighbour(pano1, pano0, !ifNeighbour, simpleJudge)
|
|
|
if(is){
|
|
|
ifNeighbour = true
|
|
@@ -1425,8 +1425,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
}
|
|
|
} */
|
|
|
// 不会再changeTex了
|
|
|
-
|
|
|
- let isNeighbour = this.isNeighbour(this.currentPano, pano, false, true);
|
|
|
+ let isNeighbour = this.isNeighbour(this.currentPano, pano, {onlyUseTex:true});
|
|
|
|
|
|
if(isNeighbour || pano.noNeighbour && disSquareMap.get(pano) < 200){//在靠近孤立点时可以通行。但是不好把握这个距离,太远的话很多地方都会不小心到孤立点,太近的话可能永远到不了。
|
|
|
return true
|
|
@@ -1451,7 +1450,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
Images360.scoreFunctions[o]( this.position, direction, true),
|
|
|
|
|
|
(pano)=>{
|
|
|
- let neighbour = this.isNeighbour(this.currentPano, pano, true, true) //不计算的
|
|
|
+ let neighbour = this.isNeighbour(this.currentPano, pano, {dontCompute:true, isNeighbour:true}) //不计算的
|
|
|
|
|
|
return neighbour ? directionFactor : 0;
|
|
|
} ,
|
|
@@ -2285,10 +2284,13 @@ Images360.prototype.getNeighbours = function(){ //逐渐自动获取neighbours
|
|
|
|
|
|
for(let a=0, b=g.length; a<b; a++){
|
|
|
let item = g[a]
|
|
|
- if(this.isNeighbour(pano, item.item, true) != void 0) continue
|
|
|
+ if(item.item == pano)continue
|
|
|
+ if(this.isNeighbour(pano,item.item,{dontCompute:true}) || this.neighbourMap[pano.id][item.item.id]!= void 0 && this.neighbourMap[item.item.id][pano.id]!= void 0)continue //为true或两个方向都算了的
|
|
|
|
|
|
+ //console.log('check isNeighbour', pano.id, item.item.id)
|
|
|
+
|
|
|
let byCloud = !pano.pointcloud.hasDepthTex
|
|
|
- let result = this.isNeighbour(pano, item.item, false, !byCloud, true)//计算
|
|
|
+ let result = this.isNeighbour(pano, item.item, {onlyUseTex: !byCloud, computeDirFirst:true, computeTwoDir:true})//计算
|
|
|
|
|
|
if(result != void 0){//计算了
|
|
|
//console.log('提前计算neighbor', pano.id, item.item.id)
|