|
@@ -1362,12 +1362,15 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
let inDirection = ()=>{
|
|
|
let dir = new THREE.Vector3().subVectors(pano1.position,pano0.position).normalize()
|
|
|
let dis = pano1.position.distanceTo(pano0.position)
|
|
|
+ let fov = THREE.Math.degToRad(viewer.mainViewport.camera.fov)
|
|
|
let hfov = cameraLight.getHFOVForCamera(viewer.mainViewport.camera , true );
|
|
|
+ let hov = Math.min(fov, hfov)
|
|
|
let max = Math.cos(THREE.Math.degToRad(10))
|
|
|
- let min = Math.cos(THREE.Math.degToRad(80))
|
|
|
- if(this.getDirection().dot(dir) > THREE.Math.clamp(Math.cos(hfov/2 ) * dis / 10, min, max )){//距离越远要求和视线角度越接近
|
|
|
+ let min = Math.cos(THREE.Math.degToRad(40))
|
|
|
+ if(this.getDirection().dot(dir) > THREE.Math.clamp(Math.cos(hov/2 ) * dis / 10, min, max )){//距离越远要求和视线角度越接近
|
|
|
return true
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
if(computeDirFirst){//先计算方向,防止重复计算ifBlockedByIntersect
|
|
|
if(inDirection()){
|
|
@@ -1550,7 +1553,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
var request = [//必要条件
|
|
|
Images360.filters.not(this.currentPano),
|
|
|
Images360.filters.isEnabled(),
|
|
|
- Images360.filters.inFloorDirection( this.position, direction, option1 ), //原先用inPanoDirection,但容易穿楼层,当mouse较低或较高
|
|
|
+ //Images360.filters.inFloorDirection( this.position, direction, option1 ), //原先用inPanoDirection,但容易穿楼层,当mouse较低或较高 //因不束缚纵向所以可能往相反反向
|
|
|
(pano)=>{
|
|
|
/* let isNeighbour = this.isNeighbour(this.currentPano, pano, true, true); //不计算的
|
|
|
if(isNeighbour == void 0){
|
|
@@ -1581,7 +1584,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
]
|
|
|
|
|
|
if(!byKey){
|
|
|
- Images360.filters.inPanoDirection( this.position, this.getDirection(), option1/* , true */) //垂直方向上再稍微限制一下, 要接近视线方向,避免点击前方时因无路而到下一楼。但不能太高,否则楼梯上稍微朝下点击都到不了上方。之所以使用视线方向是因为镜头方向比鼠标方向目的性更强。
|
|
|
+ request.push(Images360.filters.inPanoDirection( this.position, this.getDirection(), option1/* , true */)) //垂直方向上再稍微限制一下, 要接近视线方向,避免点击前方时因无路而到下一楼。但不能太高,否则楼梯上稍微朝下点击都到不了上方。之所以使用视线方向是因为镜头方向比鼠标方向目的性更强。
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2598,7 +2601,7 @@ Images360.prototype.getNeighbours = function(){ //逐渐自动获取neighbours
|
|
|
let pano = panos[i];
|
|
|
let others = panos.slice(i+1, j)
|
|
|
lastIndex = i
|
|
|
-
|
|
|
+ if(!pano.pointcloud.hasDepthTex && i>0)break; //点云的情况下最好不改相机位置,因为其他位置点云还没加载完,所以不判断当前点以外的漫游点
|
|
|
var g = Common.sortByScore(others, [ ], [
|
|
|
Images360.scoreFunctions.distanceSquared(pano.position)
|
|
|
]);
|
|
@@ -2608,7 +2611,7 @@ Images360.prototype.getNeighbours = function(){ //逐渐自动获取neighbours
|
|
|
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)
|
|
|
+ console.log('check isNeighbour', pano.id, item.item.id)
|
|
|
|
|
|
let byCloud = !pano.pointcloud.hasDepthTex
|
|
|
let result = this.isNeighbour(pano, item.item, {onlyUseTex: !byCloud, computeDirFirst:true, computeTwoDir:true})//计算
|