|
@@ -11,27 +11,7 @@ window.lerp = null
|
|
|
window.transitions = null
|
|
|
window.browser = null
|
|
|
window.momentTourBlackNewType = 0//= number == 'TEST'//true
|
|
|
-
|
|
|
-g_playAudio = null
|
|
|
-
|
|
|
-g_tourAudio = new Audio
|
|
|
-g_tourAudio.loop = !1
|
|
|
-g_tourAudio.crossOrigin = "anonymous"
|
|
|
-g_tourAudio.addEventListener("ended", function() {
|
|
|
- var e = document.createEvent("MouseEvent");
|
|
|
- e.initEvent("tourAudioEnded", !0, !0),
|
|
|
- window.dispatchEvent(e)
|
|
|
-})
|
|
|
-
|
|
|
-g_tourAudio.oncanplaythrough = function() {
|
|
|
- g_tourAudio.play();
|
|
|
- if(g_bgAudio && !g_bgAudio.paused){
|
|
|
- manage.switchBgmState(false);
|
|
|
- g_bgAudio.pauseByTour = true
|
|
|
- }
|
|
|
- g_playAudio = g_tourAudio;
|
|
|
-}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
var dealMap = (map)=>{//使不resize when image is not power of two
|
|
|
map.wrapS = map.wrapT = THREE.ClampToEdgeWrapping;
|
|
@@ -4786,7 +4766,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
if (this.currentItem = null,
|
|
|
this.destinationItem = null,
|
|
|
this.tourIsPlaying = !1,
|
|
|
- this.bgmReplay(),//xzw
|
|
|
+ //this.bgmReplay(),//xzw
|
|
|
this.transitionStage = y.None,
|
|
|
this.nextFunc = null,
|
|
|
this.onTheBus = !1,
|
|
@@ -4924,7 +4904,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
n.prototype.interrupt = function(e, t) {
|
|
|
return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
|
|
|
this.tourIsPlaying = !1,
|
|
|
- this.bgmReplay(),//xzw
|
|
|
+ //this.bgmReplay(),//xzw
|
|
|
this.interrupted = !0,
|
|
|
this.nextFunc = null,
|
|
|
this.emit(p.ActionInterrupted),
|
|
@@ -5030,33 +5010,30 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
,
|
|
|
n.prototype.goToDestination = function(e, t, i, n) {
|
|
|
- //音频
|
|
|
- //if(this.destinationItem[1] == 0){//如果是每个folder的起始
|
|
|
+ //音频
|
|
|
+
|
|
|
var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
|
|
|
if(musicInfo && musicInfo.music){
|
|
|
- var o = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
|
|
|
-
|
|
|
- let audioSrc1 = g_tourAudio.src.split('/').pop();
|
|
|
- let audioSrc2 = o.split('/').pop();
|
|
|
+ let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
|
|
|
+ let audioObj = SoundManager.list.find(e=>e.name == 'tour')
|
|
|
+ let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
|
|
|
+ let audioSrc2 = common.getFileNameFromUrl(src)
|
|
|
|
|
|
if(audioSrc1 == audioSrc2){//应该是继续播放该folder
|
|
|
if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
|
|
|
- g_tourAudio.currentTime = 0; g_tourAudio.play();
|
|
|
- }else if(g_tourAudio.paused && g_tourAudio.currentTime < g_tourAudio.duration){//未播完
|
|
|
- g_tourAudio.play()
|
|
|
+ SoundManager.play('tour',null,0) // currentTime = 0;
|
|
|
+ }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
|
|
|
+ SoundManager.play('tour')//继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
|
|
|
}
|
|
|
|
|
|
}else{//很可能是该folder的起始
|
|
|
- g_tourAudio.src = manage.dealURL(o);
|
|
|
- g_tourAudio.load()
|
|
|
+
|
|
|
+ SoundManager.play('tour', manage.dealURL(src))
|
|
|
}
|
|
|
|
|
|
- if(g_bgAudio && !g_bgAudio.paused){
|
|
|
- manage.switchBgmState(false);
|
|
|
- g_bgAudio.pauseByTour = true
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
- //}
|
|
|
+
|
|
|
if (this.onTheBus = !0,
|
|
|
this.emit("update.controls"),
|
|
|
this.player.updateLastView(),
|
|
@@ -5136,30 +5113,19 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.goToDestination()) : this.goNext()))
|
|
|
}
|
|
|
,
|
|
|
- n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
|
|
|
- //if(g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused){
|
|
|
- if(g_bgAudio && g_bgAudio.paused && g_bgAudio.pauseByTour){
|
|
|
- g_playAudio = g_bgAudio;
|
|
|
- g_tourAudio && g_tourAudio.pause();
|
|
|
- //window.tourAudio && window.tourAudio.pause();
|
|
|
- manage.switchBgmState(true);
|
|
|
- }
|
|
|
- }
|
|
|
- ,
|
|
|
+ /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
|
|
|
+
|
|
|
+
|
|
|
+ } */
|
|
|
+
|
|
|
n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
|
|
|
this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
|
|
|
- this.tourIsPlaying = !1,
|
|
|
- (!isAutoStop || g_tourAudio && g_tourAudio.paused )&&this.bgmReplay(),//xzw
|
|
|
+ this.tourIsPlaying = !1,
|
|
|
this.interrupt(),
|
|
|
this.clearWalkingSectionPaused(),
|
|
|
this.resetSpecialTransition(),
|
|
|
this.emit("update.controls"))
|
|
|
- //window.tourAudio && window.tourAudio.pause();
|
|
|
- if(!isAutoStop && g_tourAudio && g_tourAudio.paused == false )
|
|
|
- {
|
|
|
- g_tourAudio.pause();
|
|
|
- //g_tourAudio.src = ""
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
,
|
|
|
n.prototype.endTourProgress = function() {
|
|
@@ -9116,13 +9082,15 @@ window.Modernizr = function(n, e, t) {
|
|
|
P.forEach(function(e) {
|
|
|
b.addEventListener(e, u.bind(this, !1), !0),
|
|
|
w.addEventListener(e, u.bind(this, !0), !0),
|
|
|
- E.addEventListener(e, o, !0),
|
|
|
- S.forEach(function(t) {
|
|
|
+ E.addEventListener(e, o, !0)
|
|
|
+
|
|
|
+ S.forEach(function(t) {//会触发导览停止
|
|
|
t.addEventListener(e, a, !0)
|
|
|
- }),
|
|
|
+ })
|
|
|
$("#drawer img").on(e, a)
|
|
|
- }),
|
|
|
- document.addEventListener("keydown", u.bind(this, !1), !0),
|
|
|
+ })
|
|
|
+ document.addEventListener("keydown", u.bind(this, !1), !0)
|
|
|
+
|
|
|
C.on(v.TourStart, function() {
|
|
|
E.classList.add("playing")
|
|
|
})
|
|
@@ -9185,7 +9153,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
!C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
|
|
|
d(),
|
|
|
t.which !== f.SPACE && a()),
|
|
|
- i && n && s()
|
|
|
+ i && n && s()
|
|
|
}
|
|
|
}
|
|
|
function d() {
|
|
@@ -15114,7 +15082,6 @@ window.Modernizr = function(n, e, t) {
|
|
|
|
|
|
//czj 判断someData 有没有hoticon字段 修改热点的样式
|
|
|
if (window.DATA.hoticon){
|
|
|
-
|
|
|
g_HotImage = {
|
|
|
point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
|
|
|
point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
|
|
@@ -15122,14 +15089,17 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
//czj 判断someData 有没有backgroundMusic 添加音乐
|
|
|
if (window.DATA.backgroundMusic) {
|
|
|
- if(window.isLocal) g_bgAudio.src = manage.dealURL(window.DATA.backgroundMusic) ;
|
|
|
- //else g_bgAudio.src = window.DATA.backgroundMusic.substr(0,4)=="http" ? window.DATA.backgroundMusic : "//" + window.DATA.backgroundMusic;
|
|
|
- else g_bgAudio.src = window.DATA.backgroundMusic
|
|
|
-
|
|
|
+ if(window.isLocal){
|
|
|
+ SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
|
|
|
+ }else{
|
|
|
+ SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
|
|
|
+ }
|
|
|
$("#volume").show();
|
|
|
}else if (g_version === "one"){
|
|
|
- g_bgAudio.src = g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3";
|
|
|
- //g_bgAudio.src = manage.dealURL(src) ;
|
|
|
+ SoundManager.setSrc('bgm', manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3"))
|
|
|
+
|
|
|
+
|
|
|
+ $("#volume").show();
|
|
|
}
|
|
|
|
|
|
//隐藏公司logo
|
|
@@ -15879,485 +15849,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
})
|
|
|
}
|
|
|
, {}],
|
|
|
- /*********************************创建热点模型************************************************** */
|
|
|
- "hot": [function(e, t, i) {//热点
|
|
|
- "use strict";
|
|
|
- function hot(sid,d,model){
|
|
|
- this.sid = sid;
|
|
|
- /* this.position = (new r.Vector3).fromArray( this.conversionArray(d.position) )
|
|
|
- if(d.quaternion){
|
|
|
- this.quaternion = d.quaternion;
|
|
|
- }else{
|
|
|
- this.rotation = this.conversionArray(d.rotation)
|
|
|
- } */
|
|
|
-
|
|
|
- this.position = this.convertValue(d.position, r.Vector3)
|
|
|
- if(d.quaternion){
|
|
|
- this.quaternion = this.convertValue(d.quaternion, r.Quaternion)
|
|
|
- }else{
|
|
|
- this.rotation = new r.Euler().setFromVector3(this.convertValue(d.rotation, r.Vector3 ))
|
|
|
- }
|
|
|
- this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
|
|
|
- this.isSprite = d.isSprite
|
|
|
- this.actionType = (d.noAction ? 'noAction' : d.actionType) || "common"
|
|
|
- this.linkType = d.linkType || "common"
|
|
|
-
|
|
|
- this.link = d.link;
|
|
|
- this.model = model;
|
|
|
- this.size = d.size;
|
|
|
- this.infoAttribute = d.infoAttribute || {};
|
|
|
- this.styleImg = [] // 存储热点icon的图片 [{src:...}, {src:...} ] 最多两个,里面是带有src的object, 可以是img
|
|
|
- this.transformAtPanos = d.transformAtPanos || {}
|
|
|
- for (let i in this.transformAtPanos) {
|
|
|
- this.transformAtPanos[i].pos = new THREE.Vector3().fromArray(this.transformAtPanos[i].pos)
|
|
|
- this.transformAtPanos[i].qua && (this.transformAtPanos[i].qua = new THREE.Quaternion().fromArray(this.transformAtPanos[i].qua))
|
|
|
- }
|
|
|
- this.build();
|
|
|
- d.infoAttribute && d.infoAttribute.title && this.setTitleElem(d.infoAttribute.title)
|
|
|
- this.changeTex()
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- this.visibleData = d.visiblePanos
|
|
|
- //this.setVisiblePanos(d.visiblePanos);
|
|
|
-
|
|
|
- }
|
|
|
- var r = e("three")
|
|
|
- , f = e("../shaders")
|
|
|
- , a = e("../settings")
|
|
|
- , s = e("../enum/Viewmode")
|
|
|
- , p = e("../objects/Panorama")
|
|
|
- , math = e("../util/math")
|
|
|
- , te = e("../util/texture");
|
|
|
- var raycaster = new r.Raycaster;
|
|
|
- //热点大小
|
|
|
- var geometry = new r.PlaneBufferGeometry( g_HotMeshSize.g_HotMeshWidth, g_HotMeshSize.g_HotMeshHeight,1,1);
|
|
|
- var defaultTex1 = te.load(g_HotImage.point);
|
|
|
- var defaultTex2 = te.load(g_HotImage.point2);
|
|
|
-
|
|
|
-
|
|
|
- hot.prototype.changeTex = function(){
|
|
|
- var u = this.mesh.material.uniforms
|
|
|
- if(this.styleImg.length){
|
|
|
- u.texture1.value = te.load(this.styleImg[0].src);
|
|
|
- u.texture2.value = te.load(this.styleImg[1]&&this.styleImg[1].src || this.styleImg[0].src);
|
|
|
- }else{
|
|
|
- u.texture1.value = defaultTex1;
|
|
|
- u.texture2.value = defaultTex2;
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- hot.prototype.initStyleImg = function(t){
|
|
|
- this.styleImg = []
|
|
|
- t.styleImg = t.styleImg || [];
|
|
|
- t.styleImg.forEach((src)=>{
|
|
|
- this.styleImg.push({src:manage.dealURL(src)})
|
|
|
- })
|
|
|
- this.changeTex()
|
|
|
- }
|
|
|
-
|
|
|
- hot.prototype.update = function(camera) {
|
|
|
- if(this.isSprite){
|
|
|
- this.mesh.quaternion.copy(camera.quaternion)
|
|
|
- }
|
|
|
-
|
|
|
- //this.showTitle()
|
|
|
-
|
|
|
- }
|
|
|
- hot.prototype.setVisiblePanos = function(visibleData){
|
|
|
- this.visiblePanos = [];
|
|
|
-
|
|
|
- let maxCount = browser.isMobile() ? 4000 : 10000
|
|
|
- let c = this.model.panos.list.length * this.model.colliders.length
|
|
|
- if(c < maxCount){
|
|
|
- this.model.panos.list.forEach((pano)=>{// 模型遮挡的, 直接不可见
|
|
|
- if(visibleData && !visibleData.includes(pano.id))return; //在热点可视中设置过,不可见
|
|
|
- var isShelter = convertTool.ifIntersectChunks(pano.position, this.position, {model: this.model.colliders});
|
|
|
- if(!isShelter){
|
|
|
- this.visiblePanos.push(pano.id)
|
|
|
- }
|
|
|
- })
|
|
|
- }else{//防止加载时间过长,分批计算
|
|
|
- let c1 = Math.ceil(maxCount / this.model.colliders.length)
|
|
|
- let start = 0
|
|
|
- let interval = setInterval(()=>{
|
|
|
- let end = start + c1;
|
|
|
- end = Math.min(end, this.model.panos.list.length)
|
|
|
- let i = start
|
|
|
- start = end
|
|
|
- for(;i<end; i++){
|
|
|
- var pano = this.model.panos.list[i]
|
|
|
- if(visibleData && !visibleData.includes(pano.id))return; //在热点可视中设置过,不可见
|
|
|
- var isShelter = convertTool.ifIntersectChunks(pano.position, this.position, {model: this.model.colliders});
|
|
|
- if(!isShelter){
|
|
|
- this.visiblePanos.push(pano.id)
|
|
|
- }
|
|
|
- }
|
|
|
- if(end>=this.model.panos.list.length){
|
|
|
- console.log(window.hotsi ?(++window.hotsi): (window.hotsi = 1))
|
|
|
- clearInterval(interval)
|
|
|
- }
|
|
|
- },20 )
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //绘制热点
|
|
|
- hot.prototype.build = function(){
|
|
|
- var t = r.UniformsUtils.clone(f.hot.uniforms);
|
|
|
- var shaderMaterial = new r.ShaderMaterial({
|
|
|
- uniforms: t,
|
|
|
- vertexShader: f.hot.vertexShader,
|
|
|
- fragmentShader: f.hot.fragmentShader,
|
|
|
- transparent: !0
|
|
|
- })
|
|
|
- var sprite = new r.Mesh( geometry, shaderMaterial );
|
|
|
- var hotIconScale = parseFloat(this.infoAttribute.hotIconScale || window.DATA.hotIconScale);
|
|
|
- sprite.dynamic = true;
|
|
|
- sprite.position.copy(this.position);
|
|
|
- sprite.quaternion.copy(this.quaternion)
|
|
|
- hotIconScale && sprite.scale.set(hotIconScale, hotIconScale, hotIconScale)
|
|
|
- // this.size && sprite.scale.set(this.size,this.size,this.size);
|
|
|
- sprite.name = this.sid;
|
|
|
- sprite.type = "hotSprite";
|
|
|
- sprite.belongHot = this;
|
|
|
- if(this.link) sprite.hotLink = this.link;
|
|
|
- this.mesh = sprite;
|
|
|
- this.model.add(sprite);
|
|
|
- g_HotMeshes.push(sprite);
|
|
|
- }
|
|
|
- hot.prototype.setTitleElem = function(title){
|
|
|
- var root = $("#hot");
|
|
|
- var elem = $(`<div> ${title}</div>`)
|
|
|
- root.append(elem);
|
|
|
- this.titleElem = elem;
|
|
|
- }
|
|
|
- hot.prototype.showTitle = function(){
|
|
|
- if(!this.titleElem)return;
|
|
|
- var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
|
|
|
- if(pos.trueSide){//inSight
|
|
|
- this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
|
|
|
- this.titleElem.css("display","block");
|
|
|
- }else{
|
|
|
- this.titleElem.css("display","none");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /* hot.prototype.showTitle = function(){//一直显示title的话
|
|
|
- if(!this.titleElem)return;
|
|
|
-
|
|
|
- var unvisi = ()=>{
|
|
|
- this.titleElem.css("display","none");
|
|
|
- }
|
|
|
- var visi = ()=>{
|
|
|
- var pos = math.getPos2d(this.position, player.camera, $("#player")[0])
|
|
|
- if(pos.trueSide){//inSight
|
|
|
- this.titleElem.css( { "left" : `${pos.pos.x}px`, "top": `${pos.pos.y}px ` });
|
|
|
- this.titleElem.css("display","block");
|
|
|
- }else{
|
|
|
- unvisi()
|
|
|
- }
|
|
|
- }
|
|
|
- if(this.mesh.visible){
|
|
|
- if(player.mode == 'panorama'){
|
|
|
- visi()
|
|
|
- }else{
|
|
|
- var ifShelter = convertTool.ifShelter(this.position)
|
|
|
- if(ifShelter)unvisi()
|
|
|
- else visi()
|
|
|
- }
|
|
|
- }else{
|
|
|
- unvisi()
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- */
|
|
|
-
|
|
|
- hot.prototype.hideTitle = function(){
|
|
|
- if(!this.titleElem)return;
|
|
|
- this.titleElem.css("display","none");
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- hot.prototype.closestPanoTowardTag = function(e, t) {
|
|
|
-
|
|
|
- var i = []
|
|
|
- , o = []
|
|
|
- , l = this.mesh.position;
|
|
|
- if (e === s.PANORAMA) {
|
|
|
- var c = .5
|
|
|
- , h = t.position.clone().sub(l).normalize();
|
|
|
- // 方奕卓 注释掉下面的筛选条件, 使热点列表能点击过渡
|
|
|
- // i.push(p.filters.isPanoAligned()),
|
|
|
- // i.push(p.filters.inPanoDirection(l, h, c)),
|
|
|
- // i.push(p.filters.isNeighbourPanoTo(t)),
|
|
|
- o.push(p.scoreFunctions.direction(l, h))
|
|
|
- }
|
|
|
- var u = new r.Vector3
|
|
|
- , d = function(e) {
|
|
|
- u.copy(l).sub(e.position);
|
|
|
- var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
|
|
|
- , i = a.tags.navigate.tiltTolerance;
|
|
|
- return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
|
|
|
- }
|
|
|
- , f = function(e) {
|
|
|
- return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
|
|
|
- };
|
|
|
- i.push(f, d, (pano)=>{ // add
|
|
|
- return player.checkHasNeighbor(pano)
|
|
|
- }),
|
|
|
- o.push(p.scoreFunctions.distanceSquared(this.mesh, -2));
|
|
|
- var g = t.model.panos.sortByScore(i, o);
|
|
|
- if (g && a.tags.navigate.lineOfSight) {
|
|
|
- for (var m = 0; m < g.length; m++) {
|
|
|
- var v = g[m].pano
|
|
|
- , A = v.position.distanceTo(l);
|
|
|
- raycaster.set(v.position, l.clone().sub(v.position).normalize());
|
|
|
- var y = raycaster.intersectObjects(t.model.colliders);
|
|
|
- // return g[0].pano;
|
|
|
- if (0 === y.length || y[0].distance > A) {
|
|
|
- console.log(m);
|
|
|
- return v
|
|
|
- }
|
|
|
- }
|
|
|
- return null
|
|
|
- }
|
|
|
- return g && g.length > 0 && g[0].pano
|
|
|
- }
|
|
|
-
|
|
|
- var getLink = function(link){
|
|
|
- var src = '';
|
|
|
- var r = link.substring(link.indexOf("html") + 4)//给热点后面加上随机数,让热点确保是最新的
|
|
|
- , o = "en" == manage.number("lang") ? "&lang=" + manage.number("lang") : "";//如果热点的内容是英文版的
|
|
|
- -1 == r.indexOf("?") ? src = link + "?time=" + randomTime().getTime() + "&id=" + window.number + o : src = link + "&time=" + randomTime().getTime() + "&id=" + window.number + o
|
|
|
-
|
|
|
- return src
|
|
|
-
|
|
|
- }
|
|
|
- hot.prototype.examine = function(e, options) {
|
|
|
- options = options || {}
|
|
|
-
|
|
|
- if(this.actionType == 'noAction' )return;
|
|
|
- if(this.linkType!="common" && this.infoAttribute.iframe && this.infoAttribute.iframe[0] && !options.dontOpen){
|
|
|
- var src = getLink(this.infoAttribute.iframe[0]);
|
|
|
- if(this.linkType=="jumpLink"){
|
|
|
- /* var newPage = window.open(src, "_blank" );
|
|
|
- newPage.focus(); */
|
|
|
-
|
|
|
- var href = window.location.href
|
|
|
- var index = href.indexOf("&")
|
|
|
- if(index>-1) href = href.substr(0,index) /* pushState replaceState*/
|
|
|
- history.pushState(null, "", href+'&qs=1&firstView=pano:'+player.currentPano.id+',qua:'+ player.quaternion.toArray());
|
|
|
- window.location.href = src
|
|
|
-
|
|
|
-
|
|
|
- }else if(this.linkType=="iframeDiv"){
|
|
|
- var div = document.createElement("div");
|
|
|
- $("body").append(div);
|
|
|
- div.style.position = 'fixed';
|
|
|
- div.style.width = div.style.height = "100%";
|
|
|
- div.style.left = div.style.top = '0';
|
|
|
- div.style["z-index"] = "999"
|
|
|
-
|
|
|
- var exit = document.createElement("div");
|
|
|
- exit.style["background-image"] = "url(images/vrOffImg.png)";
|
|
|
- exit.style.position = 'absolute';
|
|
|
- exit.style.width = exit.style.height = "50px";
|
|
|
- exit.style.left = '17px'; exit.style.top = "20px"
|
|
|
- exit.style.cursor = "pointer";
|
|
|
- exit.style["background-repeat"] = "no-repeat";
|
|
|
- exit.style["background-size"] = "25%";
|
|
|
- exit.style["background-position"] = "center center";
|
|
|
- exit.style["background-color"] = "rgba(0, 0, 0, 0.2)";
|
|
|
- exit.style["border-radius"] = "50%";
|
|
|
- exit.style["z-index"] = "3"
|
|
|
- exit.onclick = ()=>{
|
|
|
- $(div).remove()
|
|
|
- if(g_bgAudio && g_bgAudio.pauseByHot){
|
|
|
- manage.switchBgmState(true)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- var myElement = document.createElement("iframe");
|
|
|
- myElement.style.position = 'absolute';
|
|
|
- myElement.style.width = myElement.style.height = "100%";
|
|
|
- myElement.style.left = myElement.style.top = '0';
|
|
|
-
|
|
|
- myElement.src = src
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- div.appendChild(exit);
|
|
|
- div.appendChild(myElement)
|
|
|
-
|
|
|
-
|
|
|
- //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
|
|
|
- //g_bgAudio && g_bgAudio.pause();
|
|
|
- if(g_bgAudio && !g_bgAudio.paused){
|
|
|
- manage.switchBgmState(false);
|
|
|
- g_bgAudio.pauseByHot = true
|
|
|
- }
|
|
|
- if(g_tourAudio)g_tourAudio.pause()
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if(settings.dontExamHot || this.actionType == 'dontExam'){
|
|
|
- o();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if(!player.currentPano)return;
|
|
|
- var hotPop = document.getElementById('popup');
|
|
|
- //获取那个热点的链接
|
|
|
- if(this.link){
|
|
|
- g_currentHot = this;
|
|
|
- hotPop.style.display = "block";
|
|
|
- hotPop.classList.add("wait");
|
|
|
- var myElement = document.createElement("iframe");
|
|
|
- //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
|
|
|
- //g_bgAudio && g_bgAudio.pause();
|
|
|
- if(g_bgAudio && !g_bgAudio.paused){
|
|
|
- manage.switchBgmState(false);
|
|
|
- g_bgAudio.pauseByHot = true
|
|
|
- }
|
|
|
- if(g_tourAudio)g_tourAudio.pause()
|
|
|
-
|
|
|
- var src = getLink(this.link )
|
|
|
- myElement.src = src;
|
|
|
- myElement.id = "id1";
|
|
|
- myElement.allowTransparency = "true";
|
|
|
- // myElement.scrolling = "no";
|
|
|
- var element=document.getElementById("id1"); //判断页面是否有iframe
|
|
|
- if (typeof(element)== "undefined" || element == null){
|
|
|
- document.querySelector(".popup-content").appendChild(myElement);
|
|
|
- //移动端自动播放
|
|
|
- var videoLoaddingResult = false
|
|
|
- window.loaddingSuccess = function() {
|
|
|
- videoLoaddingResult = true
|
|
|
- }
|
|
|
-
|
|
|
- setTimeout(function func() {
|
|
|
- if (videoLoaddingResult) {
|
|
|
- var $iframe = document.querySelector('#id1').contentWindow.document;
|
|
|
- if($iframe.querySelector('video')){
|
|
|
- $iframe.querySelector('video').play();
|
|
|
- // alert($iframe.querySelector('video'));
|
|
|
- if(!$iframe.querySelector('video').paused && $iframe.querySelector('.playPause')){
|
|
|
- $iframe.querySelector('.playPause').classList.add("fa-pause");
|
|
|
- }
|
|
|
- }
|
|
|
- if($iframe.querySelector('audio')){
|
|
|
- $iframe.querySelector('audio').play();
|
|
|
- }
|
|
|
- } else {
|
|
|
- setTimeout(func, 300)
|
|
|
- }
|
|
|
- }, 800);
|
|
|
- }
|
|
|
-
|
|
|
- //setTimeout(function(){$('#player').on("click",e.closePopup);},20)
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- // if(hotListSta) {
|
|
|
- // hotPop.classList.remove("wait");
|
|
|
- // return;
|
|
|
- // }
|
|
|
-
|
|
|
- var t = e.mode
|
|
|
- , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
|
|
|
- , n = this.mesh.position;
|
|
|
- e.flyingToTag = true;
|
|
|
- var o = function() {
|
|
|
- e.flyingToTag = false;
|
|
|
- if(this.link){
|
|
|
- hotPop.classList.remove("wait");
|
|
|
- }
|
|
|
-
|
|
|
- }.bind(this);
|
|
|
-
|
|
|
-
|
|
|
- if(settings.dontExamHot){
|
|
|
- o();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- if (t === s.PANORAMA){
|
|
|
- var l = {
|
|
|
- pano: i,
|
|
|
- lookAtPoint: n,
|
|
|
- duration: null,
|
|
|
- maxDistanceOverride: null,
|
|
|
- skipWarpingCheck: !1
|
|
|
- };
|
|
|
- e.flyToPano(l, o)
|
|
|
- }else {
|
|
|
- var c = {
|
|
|
- pano: i
|
|
|
- };
|
|
|
- if (n) {
|
|
|
- var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
|
|
|
- c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
|
|
|
- }
|
|
|
- c.callback = o,
|
|
|
- c.duration = 1500,
|
|
|
- c.mode = s.PANORAMA,
|
|
|
- e.flyToNewMode(c)
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
|
|
|
- // if(window.DATA.special){
|
|
|
- // specialScene.special().beforeImplement();
|
|
|
- // }
|
|
|
-
|
|
|
- //czj 判断是否是数组 如果不是将对象转换为数组
|
|
|
- /* hot.prototype.conversionArray = function(obj){
|
|
|
- if(Object.prototype.toString.call(obj)=='[object Array]') return obj;
|
|
|
- var arr = []
|
|
|
- for (var i in obj) {
|
|
|
- arr.push(obj[i]); //属性
|
|
|
- }
|
|
|
- return arr
|
|
|
- } */
|
|
|
- hot.prototype.convertValue = function(v ,Type){
|
|
|
- var value;
|
|
|
- if(v instanceof Array){
|
|
|
- v.forEach((v1)=>{v1 = parseFloat(v1)})
|
|
|
- value = new Type().fromArray(v);
|
|
|
- }else{
|
|
|
- for(let i in v){v[i] = parseFloat(v[i])}
|
|
|
- value = new Type().copy(v);
|
|
|
- }
|
|
|
- return value
|
|
|
- }
|
|
|
-
|
|
|
- t.exports = hot;
|
|
|
- }
|
|
|
- , {
|
|
|
- three: 217,
|
|
|
- "../shaders":167,
|
|
|
- "../enum/Viewmode":51,
|
|
|
- "../objects/Panorama":148,
|
|
|
- "../util/texture":194,
|
|
|
- "../settings":166,
|
|
|
- "../util/math": 190,
|
|
|
- }],
|
|
|
- /************************************创建热点模型************************************ */
|
|
|
+
|
|
|
123: [function(e, t, i) {//tag
|
|
|
(function(i) {
|
|
|
"use strict";
|
|
@@ -18288,15 +17780,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
|
|
|
|
|
|
g_index = w.valueFromHash("m");
|
|
|
- /* if(t.tourAudio){
|
|
|
- g_tourAudio = new Audio;
|
|
|
- g_tourAudio.loop = false;
|
|
|
- g_tourAudio.addEventListener('ended', function () {
|
|
|
- var ev = document.createEvent("MouseEvent");
|
|
|
- ev.initEvent("tourAudioEnded",true,true);
|
|
|
- window.dispatchEvent(ev);
|
|
|
- });
|
|
|
- }; */
|
|
|
+
|
|
|
|
|
|
}
|
|
|
/***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
|
|
@@ -22146,31 +21630,12 @@ window.Modernizr = function(n, e, t) {
|
|
|
str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
|
|
|
return str;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
//------end
|
|
|
- n.prototype.closePopup = function() {//xzw 关闭热点页面
|
|
|
- if(!g_currentHot) return;
|
|
|
- g_currentHot = null;
|
|
|
- var hotPop = document.getElementById('popup');
|
|
|
- hotPop.style.display = "none";
|
|
|
- document.querySelector(".popup-content").removeChild(document.getElementById("id1"));
|
|
|
- $("#popup iframe:last").remove();
|
|
|
- var _bgaudio = document.getElementById("bgaudio");
|
|
|
- //判断音乐是否暂停或者是否存在
|
|
|
- /* if(g_bgAudio && g_bgAudio.paused && g_bgAudio.readyState != 0 && g_play === 1)
|
|
|
- {
|
|
|
- //g_bgAudio.play();
|
|
|
- manage.switchBgmState(true)
|
|
|
- }; */
|
|
|
-
|
|
|
- if(g_bgAudio && g_bgAudio.pauseByHot){
|
|
|
- manage.switchBgmState(true)
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //$('#player').off("click",this.closePopup);
|
|
|
- return false
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
n.prototype.setupCustomProperties = function(e) {
|
|
@@ -22294,26 +21759,10 @@ window.Modernizr = function(n, e, t) {
|
|
|
return .5
|
|
|
}
|
|
|
,
|
|
|
- n.prototype.changeMusic = function() {//xzw add
|
|
|
- /* if(!this.director.tourIsPlaying && g_play && g_bgAudio){
|
|
|
- g_playAudio = g_bgAudio;
|
|
|
- //g_bgAudio.play();
|
|
|
- manage.switchBgmState(true)
|
|
|
- }else{
|
|
|
- if(!g_play){
|
|
|
- g_playAudio = g_bgAudio;
|
|
|
- }else{//防止再次播放时重播一遍
|
|
|
- g_playAudio = null;
|
|
|
- }
|
|
|
- } */
|
|
|
-
|
|
|
- /* if(!this.director.tourIsPlaying && g_bgAudio){
|
|
|
- manage.switchBgmState(true)
|
|
|
- } */
|
|
|
-
|
|
|
+ /* n.prototype.changeMusic = function() {//xzw add
|
|
|
if(!this.director.tourIsPlaying) this.director.bgmReplay()
|
|
|
- }
|
|
|
- ,
|
|
|
+ } */
|
|
|
+
|
|
|
n.prototype.bindEvents = function(e) {
|
|
|
e !== document && e.setAttribute("tabindex", -1),
|
|
|
e.addEventListener("mousedown", this.onMouseDown.bind(this)),
|
|
@@ -22336,17 +21785,12 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
|
|
|
this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
|
|
|
window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
|
|
|
- window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
|
|
|
+ //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
|
|
|
|
|
|
// lzb
|
|
|
window.getSeft && getSeft(this);
|
|
|
|
|
|
- //判断是否是移动端,如果是给关闭按钮添加touchstart事件
|
|
|
- if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
|
|
|
- $('#closepop').on("touchstart",this.closePopup.bind(this));
|
|
|
- }else{
|
|
|
- $('#closepop').on("click",this.closePopup.bind(this));
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
,
|
|
|
n.prototype.onMouseDown = function(e) {
|
|
@@ -23780,7 +23224,8 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
,
|
|
|
n.prototype.flyDirection = function(e, t, i) {
|
|
|
- this.closePopup();//xzw add
|
|
|
+ Hot.closePopup();//xzw add
|
|
|
+
|
|
|
var n = $.Deferred();
|
|
|
this.history.invalidate();
|
|
|
var r = this.closestPanoInDirection(e, t, i);
|
|
@@ -24002,6 +23447,8 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
,
|
|
|
n.prototype.flyToNewMode = function(e, t) {
|
|
|
+ Hot.closePopup();//xzw add
|
|
|
+
|
|
|
e = e || {};
|
|
|
var i = e.mode
|
|
|
, n = e.pano
|
|
@@ -24371,7 +23818,8 @@ window.Modernizr = function(n, e, t) {
|
|
|
var rotTime
|
|
|
if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
|
|
|
var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
|
|
|
- var current = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
|
|
|
+ var audioObj = SoundManager.list.find(e=>e.name == 'tour')
|
|
|
+ var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
|
|
|
rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;
|
|
|
|
|
|
if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
|
|
@@ -27048,7 +26496,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
matchCam: !1,
|
|
|
blur: .33,
|
|
|
fastTime: 1500,
|
|
|
- teleportTime: 1500,
|
|
|
+ teleportTime: 1500,//瞬间过渡的时间
|
|
|
outsideTime: 2e3,
|
|
|
lookAheadMax: .3,
|
|
|
lookAheadDist: 2.5,
|
|
@@ -31356,7 +30804,10 @@ window.Modernizr = function(n, e, t) {
|
|
|
}).sort(function(e, t) {
|
|
|
return t.score - e.score;
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
+ getFileNameFromUrl:function(url){
|
|
|
+ return url.split('/').pop();
|
|
|
+ }
|
|
|
|
|
|
|
|
|
},
|