|
@@ -4969,20 +4969,25 @@ window.Modernizr = function(n, e, t) {
|
|
var pano = this.model.panos.index[location.panoId];
|
|
var pano = this.model.panos.index[location.panoId];
|
|
var dis = pano.position.distanceTo(this.player.currentPano.position)
|
|
var dis = pano.position.distanceTo(this.player.currentPano.position)
|
|
if(dis<result.dis){
|
|
if(dis<result.dis){
|
|
- result.item = item, result.dis = dis
|
|
|
|
- }else if(dis == result.dis){//如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
|
|
|
|
-
|
|
|
|
- /* if(this.itemCompare(item, this.currentItem, 'equal')){//优先用当前的
|
|
|
|
- result.item = item, result.dis = dis
|
|
|
|
- }else if(this.currentItem && Math.abs(item[0]-this.currentItem[0]) < Math.abs(result.item[0]-this.currentItem[0])){
|
|
|
|
- result.item = item, result.dis = dis
|
|
|
|
- } */
|
|
|
|
- if(this.currentItem){
|
|
|
|
|
|
+ result.item = item, result.dis = dis, result.location = location, result.angle = null
|
|
|
|
+ }else if(dis == result.dis){
|
|
|
|
+
|
|
|
|
+ if(this.currentItem){
|
|
|
|
+ if(result.angle == void 0){
|
|
|
|
+ result.angle = result.location.quaternion.angleTo(player.quaternion)
|
|
|
|
+ }//用角度最接近的那一个
|
|
|
|
+
|
|
|
|
+ let angle = location.quaternion.angleTo(player.quaternion)
|
|
|
|
+ if(angle < result.angle){
|
|
|
|
+ result.item = item, result.dis = dis, result.location = location, result.angle = angle
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /* //如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
|
|
let dis1 = [Math.abs(item[0] - this.currentItem[0]), Math.abs(item[1] - this.currentItem[1])] //当前差距
|
|
let dis1 = [Math.abs(item[0] - this.currentItem[0]), Math.abs(item[1] - this.currentItem[1])] //当前差距
|
|
let dis2 = [Math.abs(result.item[0] - this.currentItem[0]), Math.abs(result.item[1] - this.currentItem[1])]
|
|
let dis2 = [Math.abs(result.item[0] - this.currentItem[0]), Math.abs(result.item[1] - this.currentItem[1])]
|
|
if( this.itemCompare(dis1, dis2, 'less')){
|
|
if( this.itemCompare(dis1, dis2, 'less')){
|
|
result.item = item, result.dis = dis
|
|
result.item = item, result.dis = dis
|
|
- }
|
|
|
|
|
|
+ } */
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -9133,9 +9138,9 @@ window.Modernizr = function(n, e, t) {
|
|
w.addEventListener(e, u.bind(this, !0), !0),
|
|
w.addEventListener(e, u.bind(this, !0), !0),
|
|
E.addEventListener(e, stopTour2, !0)
|
|
E.addEventListener(e, stopTour2, !0)
|
|
|
|
|
|
- S.forEach(function(t) {//会触发导览停止
|
|
|
|
|
|
+ /* S.forEach(function(t) {//会触发导览停止
|
|
t.addEventListener(e, stopTour, !0)
|
|
t.addEventListener(e, stopTour, !0)
|
|
- })
|
|
|
|
|
|
+ }) */
|
|
$("#drawer img").on(e, stopTour)
|
|
$("#drawer img").on(e, stopTour)
|
|
})
|
|
})
|
|
document.addEventListener("keydown", u.bind(this, !1), !0)
|
|
document.addEventListener("keydown", u.bind(this, !1), !0)
|
|
@@ -21551,12 +21556,16 @@ window.Modernizr = function(n, e, t) {
|
|
void 0 !== t && null !== t || (t = c.warp.teleportTime)
|
|
void 0 !== t && null !== t || (t = c.warp.teleportTime)
|
|
//add
|
|
//add
|
|
player.model.hotGroup.visible = false
|
|
player.model.hotGroup.visible = false
|
|
|
|
+ let oldPano = this.player.currentPano
|
|
|
|
+ let toPano = this.player.model.panos.get(this.warpDestHeroLoc.panoId)
|
|
|
|
+ this.player.emit("pano.chosen", oldPano, toPano)
|
|
|
|
+
|
|
var done = ()=>{
|
|
var done = ()=>{
|
|
this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:0, callback:()=>{
|
|
this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:0, callback:()=>{
|
|
player.model.hotGroup.visible = true
|
|
player.model.hotGroup.visible = true
|
|
Hot.updateVisibles([this.player.currentPano]) //更新热点显示
|
|
Hot.updateVisibles([this.player.currentPano]) //更新热点显示
|
|
}})
|
|
}})
|
|
-
|
|
|
|
|
|
+ this.player.emit("flying.ended",toPano.position, oldPano.position,toPano, oldPano)
|
|
}
|
|
}
|
|
|
|
|
|
if(window.DATA.momentTourBlackNewType){
|
|
if(window.DATA.momentTourBlackNewType){
|
|
@@ -21782,6 +21791,7 @@ window.Modernizr = function(n, e, t) {
|
|
,
|
|
,
|
|
n.prototype.endWarpState = function() {
|
|
n.prototype.endWarpState = function() {
|
|
this.warping = !1
|
|
this.warping = !1
|
|
|
|
+ this.director.emit('warp.end')//xzw add
|
|
}
|
|
}
|
|
,
|
|
,
|
|
n.prototype.warpToPano = function(e, t, i, n) {
|
|
n.prototype.warpToPano = function(e, t, i, n) {
|
|
@@ -23719,7 +23729,7 @@ window.Modernizr = function(n, e, t) {
|
|
n.prototype.warpToPano = function(o={}) {
|
|
n.prototype.warpToPano = function(o={}) {
|
|
|
|
|
|
}
|
|
}
|
|
- n.prototype.blackToPano = function(o={}) {//add 瞬间过渡
|
|
|
|
|
|
+ n.prototype.blackToPano = function(o={},callback) {//add 瞬间过渡
|
|
//o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
|
|
//o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
|
|
if(this.flying || this.isWarping() )return;
|
|
if(this.flying || this.isWarping() )return;
|
|
let pano = o.pano || this.model.panos.index[o.panoId]
|
|
let pano = o.pano || this.model.panos.index[o.panoId]
|
|
@@ -23731,7 +23741,7 @@ window.Modernizr = function(n, e, t) {
|
|
pano ,
|
|
pano ,
|
|
duration: o.duration,
|
|
duration: o.duration,
|
|
quaternion: o.quaternion ,
|
|
quaternion: o.quaternion ,
|
|
- //callback: t
|
|
|
|
|
|
+ callback
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -23748,18 +23758,18 @@ window.Modernizr = function(n, e, t) {
|
|
|
|
|
|
var retry = ()=>{
|
|
var retry = ()=>{
|
|
this.waitingToWarp = !1,
|
|
this.waitingToWarp = !1,
|
|
- this.blackToPano(o)
|
|
|
|
|
|
+ this.blackToPano(o,callback)
|
|
}
|
|
}
|
|
|
|
|
|
if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
|
|
if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
|
|
return void (this.waitingToWarp = !0)
|
|
return void (this.waitingToWarp = !0)
|
|
|
|
|
|
- this.emit("pano.chosen", oldPano, pano)
|
|
|
|
|
|
+
|
|
|
|
|
|
this.flying = true
|
|
this.flying = true
|
|
this.nextPano = pano //提前加载高清图片
|
|
this.nextPano = pano //提前加载高清图片
|
|
this.path.warpDestHeroLoc = {
|
|
this.path.warpDestHeroLoc = {
|
|
- panoId : o.panoId,
|
|
|
|
|
|
+ panoId : pano.id,
|
|
position: pano.position,
|
|
position: pano.position,
|
|
quaternion: o.quaternion || this.quaternion.clone()
|
|
quaternion: o.quaternion || this.quaternion.clone()
|
|
|
|
|
|
@@ -23769,11 +23779,11 @@ window.Modernizr = function(n, e, t) {
|
|
this.path.warpTravel_BLACK(null, 1500,1, ()=>{
|
|
this.path.warpTravel_BLACK(null, 1500,1, ()=>{
|
|
pano != this.currentPano && this.currentPano.exit()
|
|
pano != this.currentPano && this.currentPano.exit()
|
|
pano.enter()
|
|
pano.enter()
|
|
- this.currentPano = pano
|
|
|
|
- this.emit("flying.ended", pano.position, oldPos, pano, oldPano)
|
|
|
|
|
|
+ this.currentPano = pano
|
|
this.flying = false
|
|
this.flying = false
|
|
this.nextPano = null
|
|
this.nextPano = null
|
|
this.updateMarkerVisi();//add
|
|
this.updateMarkerVisi();//add
|
|
|
|
+ callback && callback()
|
|
} )
|
|
} )
|
|
|
|
|
|
}
|
|
}
|
|
@@ -60995,6 +61005,10 @@ var addMagnifier = function(){
|
|
|
|
|
|
一些后缀
|
|
一些后缀
|
|
&panoLabel 加pano标签
|
|
&panoLabel 加pano标签
|
|
|
|
+
|
|
|
|
+ director.on("tour.end") //导览结束 是否在导览播放中:player.director.tourInProgress() 不包括点击item
|
|
|
|
+ player.isWarping() //是否在导览中,包括点击item的fly
|
|
|
|
+ 我加了个 director.on("warp.end")
|
|
|
|
|
|
*/
|
|
*/
|
|
|
|
|