|
@@ -38,7 +38,7 @@ let previousView = {
|
|
|
const HighMapCubeWidth = 1
|
|
|
|
|
|
|
|
|
-const directionFactor = 200 //原先10,几乎只往距离近的走了;设置太大楼梯上不去
|
|
|
+const directionFactor = 400 //原先10,几乎只往距离近的走了;设置太大容易略过近处漫游点走向下坡,因为鼠标一般在地面,下坡的漫游点更有利
|
|
|
|
|
|
|
|
|
export class Images360 extends THREE.EventDispatcher{
|
|
@@ -276,11 +276,13 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
//要改成飞进最近的。。。
|
|
|
if(this.panos.length == 0)return
|
|
|
//this.modeChanging = true //主要是因为到全景图不会立刻成功
|
|
|
- let wait = ()=>{
|
|
|
- this.removeEventListener('flyToPanoDone',wait)
|
|
|
- if(latestRequestMode == mode ){
|
|
|
- Potree.settings.displayMode = mode
|
|
|
- }
|
|
|
+ let wait = (e)=>{
|
|
|
+ this.removeEventListener('flyToPanoDone',wait)
|
|
|
+ setTimeout(()=>{
|
|
|
+ if(latestRequestMode == mode ){
|
|
|
+ Potree.settings.displayMode = mode
|
|
|
+ }
|
|
|
+ },e.makeIt ? 1 : 50)
|
|
|
}
|
|
|
this.flyToPano({
|
|
|
pano: this.findNearestPano(),
|
|
@@ -622,6 +624,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
|
|
|
|
|
|
cancelFlyToPano(){//取消当前已有的飞行准备,前提是相机还未移动
|
|
|
+ Potree.Log('cancelFlyToPano')
|
|
|
if(viewer.mainViewport.view.isFlying())return
|
|
|
this.nextPano = null
|
|
|
this.latestToPano = null
|
|
@@ -681,13 +684,13 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
this.nextPano = pano
|
|
|
this.latestToPano = toPano
|
|
|
//this.flying = true //防止新的请求
|
|
|
-
|
|
|
+ Potree.Log('flyToPano:'+pano.id + ' , duration:'+toPano.duration)
|
|
|
|
|
|
|
|
|
{//不飞的话是否不要执行这段?
|
|
|
|
|
|
let wait = ()=> {
|
|
|
- if(this.latestToPano != toPano)return //如果取消了
|
|
|
+ if(this.latestToPano != toPano)return Potree.Log('已经取消')//如果取消了
|
|
|
setTimeout(()=>{
|
|
|
if(this.latestToPano != toPano)return
|
|
|
this.flyToPano(toPano)
|
|
@@ -952,9 +955,8 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
|
|
|
updateCube(pano0, pano1){
|
|
|
|
|
|
- if(!viewer.scene.pointclouds.some(e=>!e.hasDepthTex)) return this.updateCube2(pano0, pano1) //都hasDepthTex的话
|
|
|
-
|
|
|
if(Potree.settings.displayMode != 'showPanos')return
|
|
|
+ if(!viewer.scene.pointclouds.some(e=>!e.hasDepthTex)) return this.updateCube2(pano0, pano1) //都hasDepthTex的话
|
|
|
|
|
|
|
|
|
let f = (bound, size)=>{
|
|
@@ -1342,12 +1344,18 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
return vec.clone().applyMatrix4(rotMat)
|
|
|
}
|
|
|
let getFar = (dir, pano, origin)=>{//获取在这个方向上和墙体intersect的最远距离
|
|
|
+ let r = (pano.ceilZ - pano.floorPosition.z) * 0.14 // 高度约小,角度越小
|
|
|
+ let getAngle = (deg)=>{
|
|
|
+ deg *= r
|
|
|
+ deg = THREE.Math.clamp(deg, 1, 80);
|
|
|
+ return deg
|
|
|
+ }
|
|
|
let dirs_ = [
|
|
|
//注意:角度太大会碰到天花板或地板,越远越容易碰到, 在地下停车场就会伸展不开。 户外时需要更多向上的方向,所以上方向多一个
|
|
|
- dir.clone().setZ(Math.tan(THREE.Math.degToRad(30))).normalize(),
|
|
|
- dir.clone().setZ(Math.tan(THREE.Math.degToRad(7))).normalize(),
|
|
|
+ dir.clone().setZ(Math.tan(getAngle(30))).normalize(),
|
|
|
+ dir.clone().setZ(Math.tan(getAngle(7))).normalize(),
|
|
|
dir.clone(), // 水平方向
|
|
|
- dir.clone().setZ(-Math.tan(THREE.Math.degToRad(5))).normalize(),
|
|
|
+ dir.clone().setZ(-Math.tan(getAngle(5))).normalize(),
|
|
|
//dir.clone().setZ(-Math.tan(THREE.Math.degToRad(30))).normalize(),
|
|
|
];
|
|
|
|
|
@@ -1578,8 +1586,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
|
|
|
//console.log('updateCube',pano0.id, pano1&&pano1.id)
|
|
|
|
|
|
- let useBound = (bound, size)=>{
|
|
|
-
|
|
|
+ let useBound = (bound, size)=>{
|
|
|
size = size || bound.getSize(new THREE.Vector3)
|
|
|
let center = bound.getCenter(new THREE.Vector3)
|
|
|
size.max(new THREE.Vector3(HighMapCubeWidth,HighMapCubeWidth,HighMapCubeWidth))
|
|
@@ -1589,14 +1596,21 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
}
|
|
|
|
|
|
|
|
|
+ let getPanoBound = (pano)=>{//因漫游点可能在点云外部,如室外平地,所以需要union进漫游点
|
|
|
+ let panoBound = new THREE.Box3
|
|
|
+ panoBound.expandByPoint(pano.position)
|
|
|
+ panoBound.expandByVector(new THREE.Vector3(10,10,10));//give pano a margin
|
|
|
+ return pano.pointcloud.bound.clone().union(panoBound)
|
|
|
+ }
|
|
|
+
|
|
|
this.cube.geometry.dispose();
|
|
|
|
|
|
if(pano1){//过渡
|
|
|
|
|
|
if(pano0.pointcloud != pano1.pointcloud){ //距离太远的数据集,过渡会畸变。所以扩大skybox
|
|
|
let dis = pano0.position.distanceTo(pano1.position)
|
|
|
- if(dis > 100){
|
|
|
- let bound = pano0.pointcloud.bound.clone().union(pano1.pointcloud.bound)
|
|
|
+ if(dis > 100){
|
|
|
+ let bound = getPanoBound(pano0).union(getPanoBound(pano1))
|
|
|
let size = bound.getSize(new THREE.Vector3)
|
|
|
let max = Math.max(size.x, size.y, size.z)
|
|
|
size.set(max,max,max)
|
|
@@ -1628,12 +1642,22 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
}
|
|
|
let getFar = (dir, pano, origin)=>{//获取在这个方向上和墙体intersect的距离
|
|
|
//在垂直方向上分出多个方向,取一个最可能的接近真实的距离
|
|
|
+ let maxH = 40, minH = 2, height = pano.ceilZ - pano.floorPosition.z, minR = 0.5, maxR = 2
|
|
|
+ //let r = height (maxH - minH)* 0.14 // 高度约小,角度越小
|
|
|
+ let r = minR + ( maxR - minR) * THREE.Math.clamp((height - minH) / (maxH - minH),0,1) //THREE.Math.smoothstep(currentDis, op.nearBound, op.farBound);
|
|
|
+
|
|
|
+ let getZ = (deg)=>{
|
|
|
+ deg *= r
|
|
|
+ deg = THREE.Math.clamp(deg, 1, 80);
|
|
|
+ return Math.tan(THREE.Math.degToRad(deg))
|
|
|
+ }
|
|
|
let dirs_ = [
|
|
|
//注意:角度太大会碰到天花板或地板,越远越容易碰到, 在地下停车场就会伸展不开。 户外时需要更多向上的方向,所以上方向多一个
|
|
|
- dir.clone().setZ(Math.tan(THREE.Math.degToRad(30))).normalize(),
|
|
|
- dir.clone().setZ(Math.tan(THREE.Math.degToRad(7))).normalize(),
|
|
|
+ dir.clone().setZ(getZ(30)).normalize(),
|
|
|
+ dir.clone().setZ(getZ(15)).normalize(),
|
|
|
+ dir.clone().setZ(getZ(7)).normalize(),
|
|
|
dir.clone(), // 水平方向
|
|
|
- dir.clone().setZ(-Math.tan(THREE.Math.degToRad(5))).normalize(),
|
|
|
+ dir.clone().setZ(-getZ(5)).normalize(),
|
|
|
//dir.clone().setZ(-Math.tan(THREE.Math.degToRad(30))).normalize(),
|
|
|
];
|
|
|
|
|
@@ -1644,6 +1668,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
let projectLen = intersect && intersect.distance ? dir_.dot(dir)*intersect.distance : max; //得到project在dir的长度
|
|
|
return projectLen //得水平距离
|
|
|
})
|
|
|
+ //console.log(pano ? pano.id : 'side','disArr', disArr.slice(0))
|
|
|
disArr.sort((a,b)=>{return b-a}); //从大到小
|
|
|
//console.log(pano ? pano.id : 'side','disArr', disArr)
|
|
|
let dis = disArr[Math.floor(count2/2-0.5)] //对半、取前(中位数)
|
|
@@ -1695,26 +1720,80 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
for(let i=0;i<count1;i++){
|
|
|
dirs.push(getDir(Math.PI/2-i*angle, vec))//正的在左边
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ let dirs2 = dirs.map((dir)=>{
|
|
|
+ return {
|
|
|
+ dir,
|
|
|
+ dis: getFar(dir, pano)
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- // let sideDis = []
|
|
|
- dirs.forEach((dir, index)=>{
|
|
|
- let dis = getFar(dir, pano);
|
|
|
- // if(index == 0 || index == count1-1){
|
|
|
- // sideDis.push(dis)
|
|
|
- // }
|
|
|
- dir.multiplyScalar( dis );
|
|
|
+ //剔除那些突然间离相机很近的dir。有可能是拍摄的人、或者杆子、树
|
|
|
+ const maxRatio = 8
|
|
|
+ /* dirs2.forEach((e,i)=>{
|
|
|
+ console.log(i, e.dis)
|
|
|
+ let smallThanBefore = ()=>{
|
|
|
+ return dirs2[i-1].dis / e.dis > maxRatio
|
|
|
+ }
|
|
|
+ let smallThanAfter = ()=>{
|
|
|
+ return dirs2[i+1].dis / e.dis > maxRatio
|
|
|
+ }
|
|
|
+
|
|
|
+ if(i>0 && i<count1-1 && smallThanBefore() && smallThanAfter()){//比左右两边都小很多
|
|
|
+ e.disB = (dirs2[i-1].dis + dirs2[i+1].dis) / 2 //平均数
|
|
|
+ console.log('两者之间',i,e.disB)
|
|
|
+ }else if(i==count1-1 && smallThanBefore() ) {//比前者小很多
|
|
|
+ e.disB = dirs2[i-1].dis * 0.8
|
|
|
+ console.log('smallThanBefore', i, e.disB)
|
|
|
+ }else if(i==0 && smallThanAfter() ){//比后者小很多
|
|
|
+ e.disB = dirs2[i+1].dis * 0.8
|
|
|
+ console.log('smallThanAftere', i, e.disB)
|
|
|
+ }
|
|
|
|
|
|
+ }) */
|
|
|
+ const minWidth = 0.5
|
|
|
+ let computeWidth = (start,end)=>{
|
|
|
+ start+=1 //不包含start和end
|
|
|
+ let count = end - start ;
|
|
|
+ let dis = 0
|
|
|
+ for(let m=start;m<end;m++){//得平均数
|
|
|
+ dis += dirs2[m].dis
|
|
|
+ }
|
|
|
+ dis /= count
|
|
|
+ let angle = Math.PI / (count1-1) * count / 2
|
|
|
+ let width = dis * Math.tan(angle) //得到block的半宽度
|
|
|
+ return width
|
|
|
+ }
|
|
|
+ let changeDis = (start,end )=>{ //不包含start
|
|
|
+ start+=1 //不包含start和end
|
|
|
+ for(let m=start;m<end;m++){
|
|
|
+ dirs2[m].disB = dirs2[end].dis * 0.8
|
|
|
+ console.log('changeDis', m, dirs2[m].disB)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let start = -1
|
|
|
+ for(let i=0;i<count1;i++){//遍历时将左边dis比之小很多且宽度较小的改大
|
|
|
+ //console.log(i, dirs2[i].dis)
|
|
|
+ let j = i-1
|
|
|
+ while(j>start && dirs2[i].dis / dirs2[j].dis > maxRatio){
|
|
|
+ j--
|
|
|
+ }
|
|
|
+ let count = i-j
|
|
|
+ if(count > 1 && (count == 2 || computeWidth(j,i)<minWidth)){//若只有一个不用判断宽度直接修改,count == 2 即只有一个
|
|
|
+ changeDis(j,i)
|
|
|
+ start = i //在此之前的修改过,之后不用再判断
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ dirs2.forEach((e, index)=>{
|
|
|
+ let dir = e.dir.clone().multiplyScalar(e.disB || e.dis);
|
|
|
[maxZ,minZ].forEach(z=>{
|
|
|
posArr.push(pano.position.clone().setZ(z).add(dir)) //获取到外墙点
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
+ })
|
|
|
});
|
|
|
-
|
|
|
- //panoIndex ++
|
|
|
- //return sideDis;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1897,7 +1976,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
//this.cube.position.copy(pano1.position).multiplyScalar(-100)
|
|
|
}else{
|
|
|
|
|
|
- useBound(pano0.pointcloud.bound)
|
|
|
+ useBound(getPanoBound(pano0))
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2010,6 +2089,8 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
return this.rankedPanoInDirection(0, direction, option1, option2)
|
|
|
}
|
|
|
rankedPanoInDirection(t, direction, option1, option2){
|
|
|
+ //此direction为mouseDirection,是否需要加上相机角度的权重
|
|
|
+
|
|
|
var panoSet = {
|
|
|
pano: null,
|
|
|
candidates: [] //缓存顺序--如果需要打印的话
|
|
@@ -2025,8 +2106,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
return this.position.z - pano.position.z
|
|
|
}else{
|
|
|
return 0
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2050,18 +2130,15 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
|
|
|
|
|
|
var list = [//决胜项目
|
|
|
- Images360.scoreFunctions.distanceSquared(this.position,1, true),
|
|
|
+ Images360.scoreFunctions.distanceSquared(this.position, 1 ),
|
|
|
|
|
|
Images360.scoreFunctions[o]( this.position, direction,true),
|
|
|
-
|
|
|
|
|
|
(pano)=>{
|
|
|
- let neighbour = this.isNeighbour(this.currentPano, pano)
|
|
|
- //console.log('neighbour', pano.id, neighbour ? directionFactor*0.4 : 0)
|
|
|
- return neighbour ? directionFactor*1 : 0;
|
|
|
+ let neighbour = this.isNeighbour(this.currentPano, pano)
|
|
|
+ return neighbour ? directionFactor : 0;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
/* (pano)=>{//尽量不穿越地板到下一层
|
|
|
let dis = getHeightDis(pano)
|
|
|
return -dis * directionFactor * 0.1;
|
|
@@ -2075,14 +2152,13 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
}
|
|
|
} */
|
|
|
];
|
|
|
- if(viewer.inputHandler.intersectPoint && this.currentPano ){//方便上下楼, 考虑panos之间的角度差
|
|
|
- let pos1 = this.currentPano.floorPosition
|
|
|
- let vec1 = new THREE.Vector3().subVectors(viewer.inputHandler.intersectPoint.location, pos1 ).normalize()//应该只有atPano时才会执行到这吧?
|
|
|
+ if(viewer.inputHandler.intersect && this.currentPano ){//方便上下楼, 考虑panos之间的角度差
|
|
|
+ let pos1 = this.currentPano.floorPosition
|
|
|
+ let vec1 = new THREE.Vector3().subVectors(viewer.inputHandler.intersect.location, pos1 ).normalize()//应该只有atPano时才会执行到这吧?
|
|
|
list.push( function(pano) {
|
|
|
var pos2 = pano.floorPosition;
|
|
|
- var vec2 = pos2.clone().sub(pos1).normalize();
|
|
|
- //console.log('direction2', pano.id, vec2.dot(vec1) * directionFactor * 1 );
|
|
|
- return vec2.dot(vec1) * directionFactor * 1
|
|
|
+ var vec2 = pos2.clone().sub(pos1).normalize();
|
|
|
+ return vec2.dot(vec1) * directionFactor * 4
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -2098,7 +2174,7 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
n.pano = null),
|
|
|
e || (e = 0);
|
|
|
var r = Common.sortByScore(this.panos, t, i);
|
|
|
- //console.log('findRankedByScore', r && r.map(u=>u.item.id + '|' + u.score))
|
|
|
+ //console.log('findRankedByScore', r && r.map(u=>u.item.id + '| ' + math.toPrecision(u.score,4) + " | " + math.toPrecision(u.scores,4)))
|
|
|
|
|
|
|
|
|
return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
|
|
@@ -2108,7 +2184,11 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
|
|
|
|
|
|
isNeighbour(pano0, pano1){//是否之间没有遮挡(在加载visibles之前,自己算) 最好pano0是currentPano
|
|
|
+
|
|
|
if(!pano0 || !pano1)return
|
|
|
+
|
|
|
+ let margin = 0.1;
|
|
|
+
|
|
|
let map0 = this.neighbourMap[pano0.id];
|
|
|
if(!map0){
|
|
|
map0 = {}
|
|
@@ -2119,26 +2199,61 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
map1 = {}
|
|
|
this.neighbourMap[pano1.id] = map1
|
|
|
}
|
|
|
-
|
|
|
+ //三个方向 : position0到position1, position0到floorPosition1, position1到floorPosition0。 只要有一个满足ifNeighbour就为true
|
|
|
+ //0能看到1不代表1能看到0; 但只要有一方能完全看到另一方,无论是position还是floorPosition都算是neighbor
|
|
|
|
|
|
- let ifNeighbour = map0[pano1.id]//map0.get(pano1)
|
|
|
+ let ifNeighbour = map0[pano1.id] || map1[pano0.id]
|
|
|
|
|
|
- if(ifNeighbour == void 0){
|
|
|
- ifNeighbour = true
|
|
|
+ let getNeighbour = (mainPano, subPano, jumpStep1)=>{
|
|
|
+ //暂时只判断到pano,不判断到marker的方向
|
|
|
+ let dir = new THREE.Vector3().subVectors(subPano.position, mainPano.position).normalize();
|
|
|
|
|
|
- let margin = 0.1;
|
|
|
+ let dirPoints = []
|
|
|
+ if(!jumpStep1){//跳过此步骤,因为之前算过不成功(虽然用另一个漫游点算的可能拍摄时间不同所以有概率不一样,如人走动)
|
|
|
+ dirPoints.push([subPano.position, mainPano.position])
|
|
|
+ }
|
|
|
+ dirPoints.push([subPano.floorPosition.clone().add(new THREE.Vector3(0,0,0.1)), mainPano.position])
|
|
|
|
|
|
- let usePointcloud = pano0.depthTex
|
|
|
- if(pano0.depthTex || pano1.depthTex){
|
|
|
- let mainPano = pano0.depthTex ? pano0 : pano1;
|
|
|
- let subPano = pano0.depthTex ? pano1 : pano0;
|
|
|
-
|
|
|
- //暂时只判断到pano,不判断到marker的方向
|
|
|
- let dir = new THREE.Vector3().subVectors(subPano.position, mainPano.position).normalize();
|
|
|
+ for(let i=0; i<dirPoints.length; i++){
|
|
|
+ let dir = new THREE.Vector3().subVectors(dirPoints[i][0], dirPoints[i][1]).normalize();
|
|
|
let intersectPoint = viewer.images360.depthSampler.sample({dir}, mainPano, true)
|
|
|
- if(intersectPoint && intersectPoint.distance+margin <= pano0.position.distanceTo(pano1.position)){
|
|
|
- ifNeighbour = false
|
|
|
+ if(!intersectPoint || intersectPoint.distance+margin > pano0.position.distanceTo(pano1.position)){
|
|
|
+ return true
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //let usePointcloud = pano0.depthTex
|
|
|
+
|
|
|
+ if(!ifNeighbour) {
|
|
|
+ if(pano0.depthTex || pano1.depthTex){
|
|
|
+
|
|
|
+ if(map0[pano1.id] == void 0 || map1[pano0.id] == void 0 ){
|
|
|
+
|
|
|
+ let mainPano = pano0.depthTex ? pano0 : pano1;
|
|
|
+ let subPano = pano0.depthTex ? pano1 : pano0;
|
|
|
+ //let notPosNeighbor = false
|
|
|
+ if(map0[pano1.id] == void 0 && pano0.depthTex){
|
|
|
+ let is = getNeighbour(pano0, pano1)
|
|
|
+ if(is){
|
|
|
+ ifNeighbour = true
|
|
|
+ }
|
|
|
+ map0[pano1.id] = !!is
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!ifNeighbour && map1[pano0.id] == void 0 && pano1.depthTex){
|
|
|
+ let is = getNeighbour(pano1, pano0, !ifNeighbour)
|
|
|
+ if(is){
|
|
|
+ ifNeighbour = true
|
|
|
+ }
|
|
|
+ map1[pano0.id] = !!is
|
|
|
+ }
|
|
|
+
|
|
|
+ /* if(ifNeighbour){ //需要标记成全部true吗,不标记也能get到,但标记了更直观,不标记保留信息更多
|
|
|
+ map0[pano1.id] = map1[pano0.id] = true
|
|
|
+ } */
|
|
|
+ }
|
|
|
}else{
|
|
|
//使用点云判断(有深度贴图时不会执行到这)
|
|
|
ifNeighbour = !viewer.inputHandler.ifBlockedByIntersect(pano1.position, margin, true, pano0.position)
|
|
@@ -2153,11 +2268,10 @@ export class Images360 extends THREE.EventDispatcher{
|
|
|
ifNeighbour = undefined //不确定
|
|
|
}
|
|
|
}
|
|
|
+ map0[pano1.id] = map1[pano0.id] = ifNeighbour //写简单点
|
|
|
}
|
|
|
-
|
|
|
- map0[pano1.id] = ifNeighbour//map0.set(pano1, ifNeighbour)
|
|
|
- map1[pano0.id] = ifNeighbour//map1.set(pano0, ifNeighbour)
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
return ifNeighbour
|
|
|
}
|
|
|
|
|
@@ -2965,12 +3079,18 @@ Images360.scoreFunctions = {
|
|
|
}
|
|
|
|
|
|
},
|
|
|
-
|
|
|
- distanceSquared: function(pos1, r, ifLog) {
|
|
|
+ distance: function(pos1, r, ifLog) {
|
|
|
if(pos1.position)pos1 = pos1.position
|
|
|
return function(pano) {//许钟文 改
|
|
|
var pos2 = pano.position.clone()
|
|
|
//ifLog && console.log('distanceSquared', pano.id, pos1.distanceToSquared(pos2) * -1 )
|
|
|
+ return pos1.distanceTo(pos2) * -1 * r;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ distanceSquared: function(pos1, r ) {
|
|
|
+ if(pos1.position)pos1 = pos1.position
|
|
|
+ return function(pano) {//许钟文 改
|
|
|
+ var pos2 = pano.position.clone()
|
|
|
return pos1.distanceToSquared(pos2) * -1 * r;
|
|
|
}
|
|
|
},
|