|
@@ -3085,7 +3085,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
insideNear: .1,
|
|
|
insideFar: 5e3,
|
|
|
insideLookSpeed: .12,
|
|
|
- insideLookLimitUp: 40,
|
|
|
+ insideLookLimitUp: 40, //视角
|
|
|
insideLookLimitDown: -40,
|
|
|
orthoNear: 1,
|
|
|
orthoFar: 5e3,
|
|
@@ -4534,22 +4534,22 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.updateModel(),
|
|
|
this.resetAll(),
|
|
|
this.bindEvents()
|
|
|
- // zeg 查询pano对应的导览片段
|
|
|
- if(!this.panoIdMap) {
|
|
|
- this.panoIdMap = new Map()
|
|
|
- this.model.heroLocations.forEach( (value, index) => {
|
|
|
- // value.heroLocations.forEach( hl => {
|
|
|
- if(!value.heroLocations) return
|
|
|
- let hl = value.heroLocations[0]
|
|
|
- let arr = this.panoIdMap.get(hl.panoId)
|
|
|
- if(arr){
|
|
|
- this.panoIdMap.set(hl.panoId, [...arr, index])
|
|
|
- } else {
|
|
|
- this.panoIdMap.set(hl.panoId, [index])
|
|
|
- }
|
|
|
- // })
|
|
|
- })
|
|
|
- }
|
|
|
+ // // zeg 查询pano对应的导览片段
|
|
|
+ // if(!this.panoIdMap) {
|
|
|
+ // this.panoIdMap = new Map()
|
|
|
+ // this.model.heroLocations.forEach( (value, index) => {
|
|
|
+ // // value.heroLocations.forEach( hl => {
|
|
|
+ // if(!value.heroLocations) return
|
|
|
+ // let hl = value.heroLocations[0]
|
|
|
+ // let arr = this.panoIdMap.get(hl.panoId)
|
|
|
+ // if(arr){
|
|
|
+ // this.panoIdMap.set(hl.panoId, [...arr, index])
|
|
|
+ // } else {
|
|
|
+ // this.panoIdMap.set(hl.panoId, [index])
|
|
|
+ // }
|
|
|
+ // // })
|
|
|
+ // })
|
|
|
+ // }
|
|
|
}
|
|
|
,
|
|
|
n.prototype.resetAll = function() {
|
|
@@ -4908,33 +4908,83 @@ window.Modernizr = function(n, e, t) {
|
|
|
.bind(this), this.goNext.bind(this))
|
|
|
}
|
|
|
,
|
|
|
- n.prototype.playTour = function() {
|
|
|
- if (!this.bounceable()) {
|
|
|
-
|
|
|
- if(!this.currentItem) this.currentItem = []
|
|
|
- if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
|
|
|
- // zeg 从当前pano进行自动导览
|
|
|
- let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
|
|
|
- // this.model.heroLocations.forEach( (value, index) => {
|
|
|
- // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
|
|
|
- // currentPanoDestinations.push(index)
|
|
|
- // }
|
|
|
- // })
|
|
|
-
|
|
|
- if(!currentPanoDestinations) {
|
|
|
- // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
|
|
|
- let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
|
|
|
- let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
|
|
|
- for(var i = 0; i < neighbourIndex.length; i++) {
|
|
|
- currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
|
|
|
- if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ n.prototype.findNearestItem = function(){//找到离currentPano最近的导览
|
|
|
+ var result = {item:[0,0], dis:Infinity};
|
|
|
+ var compare = (location, item)=>{
|
|
|
+ if(location.panoId != void 0 && location.panoId!= "outside"){
|
|
|
+ var pano = this.model.panos.index[location.panoId];
|
|
|
+ var dis = pano.position.distanceTo(this.player.currentPano.position)
|
|
|
+ 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
|
|
|
+ } */
|
|
|
+ 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(!currentPanoDestinations) currentPanoDestinations = [0];
|
|
|
- }
|
|
|
- if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
|
|
|
- this.currentItem[0] = currentPanoDestinations[0]
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ }
|
|
|
+ this.model.heroLocations.forEach((e,i)=>{
|
|
|
+ if(e.heroLocations){
|
|
|
+ /* e.heroLocations.forEach((a,j)=>{
|
|
|
+ compare(a, [i,j])
|
|
|
+ }) */
|
|
|
+ var location = e.heroLocations.find(e=>e.panoId != void 0)
|
|
|
+ location && compare(location, [i,0])
|
|
|
+
|
|
|
+ }else{
|
|
|
+ compare(e, [i,0])
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ return result.item
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ n.prototype.playTour = function() {
|
|
|
+ if (!this.bounceable() && this.model.heroLocations.length) {
|
|
|
+
|
|
|
+ // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
|
|
|
+ // if(!this.currentItem) this.currentItem = []
|
|
|
+ // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
|
|
|
+ // // zeg 从当前pano进行自动导览
|
|
|
+ // let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
|
|
|
+ // // this.model.heroLocations.forEach( (value, index) => {
|
|
|
+ // // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
|
|
|
+ // // currentPanoDestinations.push(index)
|
|
|
+ // // }
|
|
|
+ // // })
|
|
|
+
|
|
|
+ // if(!currentPanoDestinations) {
|
|
|
+ // // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
|
|
|
+ // let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
|
|
|
+ // let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
|
|
|
+ // for(var i = 0; i < neighbourIndex.length; i++) {
|
|
|
+ // currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
|
|
|
+ // if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
|
|
|
+ // }
|
|
|
+ // if(!currentPanoDestinations) currentPanoDestinations = [0];
|
|
|
+ // }
|
|
|
+ // if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
|
|
|
+ // this.currentItem[0] = currentPanoDestinations[0]
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
|
|
|
this.tourInProgress = !0,
|
|
@@ -4946,11 +4996,39 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.emit("update.controls"),
|
|
|
this.emit(p.TourStart),
|
|
|
this.player.enablePreRendering(),
|
|
|
- this.currentItem[1] = null,
|
|
|
+ // this.currentItem[1] = null,
|
|
|
this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
|
|
|
this.goToDestination()) : this.goNext()))
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ n.prototype.playTourNearBy = function() {
|
|
|
+
|
|
|
+ if (!this.bounceable()){
|
|
|
+ return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
|
|
|
+ this.tourInProgress = !0,
|
|
|
+ this.reachSource = "play",
|
|
|
+ this.tourIsPlaying = !0,
|
|
|
+ this.wasZoomEnabled = this.player.zoomEnabled,
|
|
|
+ this.player.zoomEnabled = !1,
|
|
|
+ this.resetSpecialTransition(),
|
|
|
+ this.emit("update.controls"),
|
|
|
+ this.emit(p.TourStart),
|
|
|
+ this.player.enablePreRendering(),
|
|
|
+
|
|
|
+ /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
|
|
|
+ this.goToDestination()) : this.goNext())) */
|
|
|
+
|
|
|
+
|
|
|
+ this.setDestinationItem(this.findNearestItem()) , this.goToDestination()) )
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
,
|
|
|
/* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
|
|
|
|
|
@@ -5123,15 +5201,15 @@ window.Modernizr = function(n, e, t) {
|
|
|
|
|
|
A.debug("tourAdvance(" + e + ")")
|
|
|
|
|
|
- // zeg改
|
|
|
+ // // zeg改
|
|
|
if(null === this.currentItem || void 0 === this.currentItem){
|
|
|
// this.setDestinationItem(this.firstDestination())
|
|
|
// this.setDestinationItem([currentPanoDestinations[0], 0])
|
|
|
this.setDestinationItem([this.currentItem[0], 0])
|
|
|
}
|
|
|
- else if(this.currentItem[1] == null) {
|
|
|
- this.setDestinationItem([this.currentItem[0], 0])
|
|
|
- }
|
|
|
+ // else if(this.currentItem[1] == null) {
|
|
|
+ // this.setDestinationItem([this.currentItem[0], 0])
|
|
|
+ // }
|
|
|
else{
|
|
|
|
|
|
var item
|
|
@@ -5144,7 +5222,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.setDestinationItem(item)
|
|
|
}
|
|
|
|
|
|
- if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
|
|
|
+ if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')){
|
|
|
this.useSpecialTransition("reverse-looping to end")
|
|
|
}else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
|
|
|
this.useSpecialTransition("looping back to start")
|
|
@@ -8946,7 +9024,8 @@ window.Modernizr = function(n, e, t) {
|
|
|
})
|
|
|
}
|
|
|
function r() {
|
|
|
- C.playTour(),
|
|
|
+ // C.playTour(),
|
|
|
+ C.playTourNearBy(),
|
|
|
I && clearTimeout(I),
|
|
|
d(),
|
|
|
_.removeClass("fadeIn")
|
|
@@ -23765,7 +23844,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
,
|
|
|
n.prototype.getCurrentNodePanos = function(e) {
|
|
|
this.model.panos.map;
|
|
|
- if (e.length = 0, this.path.nodes){
|
|
|
+ if (e.length = 0, this.path.nodes.length){
|
|
|
|
|
|
var momentTour = this.director.getMomentTour(this.director.destinationItem)
|
|
|
if(momentTour == 'black'){ //改 upcomingPanos如果是black的只需要起点和终点
|