|
@@ -2,322 +2,9 @@
|
|
|
另外 所有"matter"字样已被我删除 原因:删除matterport信息
|
|
|
*/
|
|
|
|
|
|
-
|
|
|
-window.common = null;
|
|
|
-window.MathLight = null;
|
|
|
-window.math = null
|
|
|
-window.easing = null
|
|
|
-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;
|
|
|
- map.minFilter = THREE.LinearFilter;
|
|
|
- map.magFilter = THREE.LinearFilter;
|
|
|
- map.generateMipmaps = true;
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-var dom = {//许钟文add
|
|
|
- getOffset: function(type, element, parent) {
|
|
|
- left = (type == "left") ? element.offsetLeft : element.offsetTop;
|
|
|
- if (!parent) parent = $("body")[0];
|
|
|
- while (element = element.offsetParent) {
|
|
|
- if (element == parent) break;
|
|
|
- left += (type == "left") ? element.offsetLeft : element.offsetTop;
|
|
|
- }
|
|
|
- return left;
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
-
|
|
|
-var getTransformSid = function(){
|
|
|
- var name
|
|
|
- if(player.mode == 'panorama'){
|
|
|
- name = player.currentPano ? player.currentPano.id : 'outside'
|
|
|
- }else{
|
|
|
- name = 'outside'
|
|
|
- }
|
|
|
- return name
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-/*
|
|
|
-var addMagnifier = function(){
|
|
|
-
|
|
|
- class Magnifier extends THREE.Object3D {
|
|
|
- constructor () {
|
|
|
- super()
|
|
|
-
|
|
|
- let circleGeo = new THREE.CircleGeometry(0.1, 100);
|
|
|
-
|
|
|
-
|
|
|
- this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
|
|
|
-
|
|
|
- this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
|
|
|
- minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
|
|
|
- format: THREE.RGBAFormat ,
|
|
|
- //type: THREE.FloatType,
|
|
|
- //minFilter: THREE.NearestFilter,
|
|
|
- //magFilter: THREE.NearestFilter,
|
|
|
-
|
|
|
- } )
|
|
|
-
|
|
|
-
|
|
|
- this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
|
|
|
- side: THREE.DoubleSide ,
|
|
|
- map: this.renderTarget.texture ,
|
|
|
- transparent:true,
|
|
|
- depthTest: !1,
|
|
|
- depthWrite: !1,
|
|
|
- }))
|
|
|
- this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
|
|
|
- side: THREE.DoubleSide ,
|
|
|
- map: Texture.load('images/crosshair.png') ,
|
|
|
- transparent:true,
|
|
|
- depthTest: !1,
|
|
|
- depthWrite: !1,
|
|
|
- }))
|
|
|
- this.add(this.mesh)
|
|
|
- this.add(this.overlayMesh)
|
|
|
-
|
|
|
- player.model.add(this);
|
|
|
- player.magnifier = this;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- update(aimPos){
|
|
|
-
|
|
|
- const magDistance_ = 0.3;
|
|
|
-
|
|
|
- var playerPos = player.position
|
|
|
- var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
|
|
|
- this.camera.position.copy(aimPos.clone().add(vec))
|
|
|
- this.camera.lookAt(aimPos)
|
|
|
-
|
|
|
-
|
|
|
- var playerCamera = player.camera
|
|
|
- this.quaternion.copy(playerCamera.quaternion);
|
|
|
-
|
|
|
- var pos2d = player.mouse.clone();
|
|
|
- var shift = 400;
|
|
|
- var clientHeight = player.domElement.clientHeight
|
|
|
- var clientY = - (pos2d.y - 1) * clientHeight / 2;
|
|
|
- pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
|
|
|
- let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
|
|
|
- this.position.copy(newPos)
|
|
|
-
|
|
|
-
|
|
|
- var renderer = player.sceneRenderer.renderer
|
|
|
- var oldAutoClear = renderer.autoClear
|
|
|
- renderer.autoClear = false
|
|
|
- //renderer.clear( true, true, true );
|
|
|
- renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
|
|
|
-
|
|
|
- renderer.autoClear = oldAutoClear
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- new Magnifier()
|
|
|
-}
|
|
|
- */
|
|
|
-
|
|
|
-var convertTool = {
|
|
|
- getPos2d : function(point, camera, dom){//获取一个三维坐标对应屏幕中的二维坐标
|
|
|
- var camera = camera || player.camera;
|
|
|
- var dom = dom || player.domElement;
|
|
|
- var pos = point.clone().project(camera) //比之前hotspot的计算方式写得简单 project用于3转2(求法同shader); unproject用于2转3 :new r.Vector3(e.x, e.y, -1).unproject(this.camera);
|
|
|
-
|
|
|
- var x,y;
|
|
|
- x = (pos.x + 1) / 2 * dom.clientWidth;
|
|
|
- y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
|
|
|
-
|
|
|
- var inSight = x <= dom.clientWidth && x >= 0 //是否在屏幕中
|
|
|
- && y <= dom.clientHeight && y >= 0
|
|
|
-
|
|
|
-
|
|
|
- return {
|
|
|
- pos: new THREE.Vector2(x,y), // 屏幕像素坐标
|
|
|
- vector: pos, //(范围 -1 ~ 1)
|
|
|
- trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
|
|
|
- inSight : inSight //在屏幕范围内可见
|
|
|
- };
|
|
|
- },
|
|
|
-
|
|
|
- ifShelter: function(pos3d){//检测某点在视线中是否被mesh遮挡
|
|
|
- var ori = player.position
|
|
|
- var dir = pos3d.clone().sub(ori).normalize()
|
|
|
- var ray = new THREE.Raycaster(ori, dir) //由外向里 因为模型从内侧是可见的所以从外侧
|
|
|
-
|
|
|
- /* if(config.isEdit && publicObjectSet.editor.mainDesign.editing){
|
|
|
- var o = ray.intersectObjects(publicObjectSet.editor.mainDesign.wallMeshes);
|
|
|
- }else{ */
|
|
|
- var o = ray.intersectObjects(player.model.colliders);
|
|
|
- //}
|
|
|
- var len = pos3d.distanceTo(ori);
|
|
|
- if (o && o.length) {
|
|
|
- for(var i=0;i<o.length;i++){
|
|
|
- if(o[i].distance < len){ return true; }//有遮挡
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- /*
|
|
|
- 拖拽时,获取鼠标在拖拽面上的位置(需要借助另一个intersectPlane面来计算,即和相机方向一样的面,可保证铺满屏幕)
|
|
|
- 但是不一定能获取到,比如鼠标射线不朝向拖拽面时,即使获取也会是一个意外的反方向的交点。
|
|
|
- */
|
|
|
- getPosAtPlane : function(pos, info/* , mouse, camera */){ //pos:与intersectPlane的交点 见笔记
|
|
|
- var A = pos;
|
|
|
- var player = player;
|
|
|
- var mouse = player.mouse;
|
|
|
- var O = new THREE.Vector3(mouse.x, mouse.y, -1).unproject(player.camera);
|
|
|
-
|
|
|
-
|
|
|
- if(info.y != void 0){//地面线的
|
|
|
-
|
|
|
- var y = info.y;
|
|
|
-
|
|
|
- if(player.mode == "floorplan"/* || Math.abs(O.x-pos.x)<0.0001 && Math.abs(O.z-pos.z)<0.0001) */){
|
|
|
- //intersectPlane和地面平行,无交点
|
|
|
- var x = pos.x, z = pos.z;
|
|
|
-
|
|
|
- }else{
|
|
|
-
|
|
|
- if(y<player.camera.position.y && O.y <= A.y /* || y>player.camera.position.y && O.y >= A.y */)return null; //鼠标射线向上。因为相机一定位于地面以上(地面不会抬高到相机上吧?),所以无交点。
|
|
|
- if(O.y == A.y){console.log('一样??');return;}
|
|
|
- if(A.y == y){console.log('一样2??');return;}
|
|
|
- var r = (O.y-y)/(A.y-y);
|
|
|
- var x = (r*A.x-O.x)/(r-1);
|
|
|
- var z = (r*A.z-O.z)/(r-1);
|
|
|
- }
|
|
|
- }else{//垂直的也有越过消失点以后反向变化的情况,但使用时影响不大
|
|
|
- var N = info.normalVec;
|
|
|
- var P = info.pullPos;
|
|
|
- if(N.y != 0 ){console.log('N.y != 0');return;} //仅仅支持垂直于地面的的墙壁,目前都是
|
|
|
- if(O.z==A.z){console.log('O.z==A.z?');return;}
|
|
|
- if(N.z!=0 && N.x != 0){//直接用这个通用的也可以,支持斜线的墙
|
|
|
- //console.log('N.z==0 && N.x == 0?');
|
|
|
- var c = ( N.x*(A.x-O.x) + N.y*(A.y-O.y) + N.z*(A.z-O.z));
|
|
|
- if(c == 0){console.log("分母为0?? return;");return;}
|
|
|
- var t = -((N.x*O.x + N.y*O.y + N.z*O.z) - (P.x*N.x + P.y*N.y + P.z*N.z) ) / c
|
|
|
- var x = t * (A.x - O.x) + O.x;
|
|
|
- var y = t * (A.y - O.y) + O.y;
|
|
|
- var z = t * (A.z - O.z) + O.z;
|
|
|
- /*原理: 已知空间直线L:(x-a)/m=(x-b)/n=(z-c)/p和空间平面π:Ax+By+Cz+D=0;
|
|
|
- 求直线L与平面π的交点的坐标。
|
|
|
- 把直线方程改写成参数形式:设(x-a)/m=(x-b)/n=(z-c)/p=t;
|
|
|
- 则x=mt+a;y=nt+b;z=pt+c;代入平面π的方程得:
|
|
|
- A(mt+a)+B(nt+b)+C(pt+c)+D=0
|
|
|
- 由此解得t=-(Aa+Bb+Cc+D)/(Am+Bn+Cp)
|
|
|
- 再代入参数方程即得交点的坐标(x,y,z). */
|
|
|
- }else if(N.x ==0 ){ //z与pullPos相等
|
|
|
- var z = P.z;
|
|
|
- if(O.y == A.y){console.log('一样??');return;}
|
|
|
- if(A.y == y){console.log('一样2??');return;}
|
|
|
- if(A.z == z){console.log('一样3??');return;}
|
|
|
- var r = (O.z-z)/(A.z-z);
|
|
|
- var x = (r*A.x-O.x)/(r-1);
|
|
|
- var y = (r*A.y-O.y)/(r-1);
|
|
|
- }else if(N.z == 0){//x与pullPos相等
|
|
|
- var x = P.x;
|
|
|
- if(O.y == A.y){console.log('一样??');return;}
|
|
|
- if(A.y == y){console.log('一样2??');return;}
|
|
|
- if(A.x == x){console.log('一样3??');return;}
|
|
|
- var r = (O.x-x)/(A.x-x);
|
|
|
- var y = (r*A.y-O.y)/(r-1);
|
|
|
- var z = (r*A.z-O.z)/(r-1);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return new THREE.Vector3(x,y,z);
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- getMouseIntersect : function(camera, meshes, mouse){//获取鼠标和meshes交点
|
|
|
- var raycaster = new THREE.Raycaster;
|
|
|
- camera.updateMatrixWorld();
|
|
|
- var origin = new THREE.Vector3(mouse.x,mouse.y,-1).unproject(camera)
|
|
|
- , end = new THREE.Vector3(mouse.x,mouse.y,1).unproject(camera);
|
|
|
- var dir = end.sub(origin).normalize()
|
|
|
- raycaster.set(origin, dir);
|
|
|
- var n = raycaster.intersectObjects(meshes);
|
|
|
- if (0 === n.length)
|
|
|
- return null;
|
|
|
- return n[0];
|
|
|
-
|
|
|
- },
|
|
|
- ifIntersectChunks : function(A,B,options={}){//获取某个线段/射线和meshes的交点
|
|
|
- var dir = B.clone().sub(A).normalize();
|
|
|
- var len = options.InfinityLen ? Infinity : A.distanceTo(B) + (options.extLen||0);
|
|
|
- var ray = new THREE.Raycaster(A.clone(), dir, 0, len);
|
|
|
-
|
|
|
- var o = ray.intersectObjects(options.model || player.model.colliders);
|
|
|
- if (o && o.length)return o;
|
|
|
-
|
|
|
- if(options.throughWidth){ //允许最小宽度,防止穿过极小的缝隙导致撞墙感
|
|
|
- var normal = math.getNormal({points:[{x:A.x, y:A.z},{x:B.x, y:B.z}]});//线段法线
|
|
|
- normal.multiplyScalar(options.throughWidth)
|
|
|
- var normalVec3 = new THREE.Vector3(normal.x, 0, normal.y);
|
|
|
-
|
|
|
- var A2 = A.clone().add(normalVec3)
|
|
|
- ray.set(A2, dir);
|
|
|
- var o2 = ray.intersectObjects(options.model || player.model.colliders);
|
|
|
- ray.set(A.clone().add(normalVec3.negate()), dir);
|
|
|
- if (o2 && o2.length)return o2;
|
|
|
- var o3 = ray.intersectObjects(options.model || player.model.colliders);
|
|
|
- if (o3 && o3.length)return o3;
|
|
|
- }
|
|
|
- return null;
|
|
|
- },
|
|
|
- getPosAtSphere : function(pos3d, toPanoPos){
|
|
|
- var dir = pos3d.clone().sub(toPanoPos);
|
|
|
- dir.normalize();//然后计算在球中
|
|
|
- dir.multiplyScalar(Constants.skyRadius);
|
|
|
- dir.add(toPanoPos);
|
|
|
- return dir;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
!function() {
|
|
|
"use strict";
|
|
|
function t(t, i) {
|
|
@@ -4786,7 +4473,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,
|
|
@@ -4819,11 +4506,11 @@ window.Modernizr = function(n, e, t) {
|
|
|
})
|
|
|
}
|
|
|
,
|
|
|
- n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
|
|
|
- return e === u.WALK && (this.interrupt(g.NONE),
|
|
|
+ n.prototype.checkAndHandleWalkingtourInterruption = function(e) {//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
|
|
|
+ return /* e === u.WALK && ( */this.interrupt(g.NONE),
|
|
|
this.pauseWalkingSection(),
|
|
|
this.player.fastForwardActivePanoFlight(),
|
|
|
- !0)
|
|
|
+ !0/* ) */
|
|
|
}
|
|
|
,
|
|
|
n.prototype.handlePlayerMove = function(e) {
|
|
@@ -5030,33 +4717,35 @@ 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(),
|
|
@@ -5077,10 +4766,11 @@ window.Modernizr = function(n, e, t) {
|
|
|
, a1 = null;
|
|
|
if (r.isPano()) {
|
|
|
|
|
|
+
|
|
|
//var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
|
|
|
//var walk = window.DATA.black ? 'black' : 'walk';
|
|
|
-
|
|
|
- var s = this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
|
|
|
+ //若是点击item,直接瞬间过渡。
|
|
|
+ var s = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
|
|
|
a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
|
|
|
o = this.arrivedAtDestination.bind(this, !0)
|
|
|
|
|
@@ -5136,30 +4826,25 @@ 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() {
|
|
@@ -5178,7 +4863,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.clearWalkingSectionPaused(),
|
|
|
this.setDestinationItem(e),
|
|
|
this.useSpecialTransition("Hilight"),
|
|
|
- this.goToDestination(),
|
|
|
+ this.goToDestination(true),//add true
|
|
|
h.trackAlways("reach_highlight", {
|
|
|
reach_source: "thumb"
|
|
|
})
|
|
@@ -14749,6 +14434,18 @@ window.Modernizr = function(n, e, t) {
|
|
|
})
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ {//初始化导览时间
|
|
|
+ if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
|
|
|
+ window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
|
|
|
+
|
|
|
+
|
|
|
+ if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
|
|
|
+
|
|
|
+ if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
|
|
|
+ DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
|
|
|
+ }
|
|
|
+ }
|
|
|
}).fail(e=>{
|
|
|
alert("缺少someData文件,请检查场景码是否正确。")
|
|
|
})
|
|
@@ -15136,14 +14833,22 @@ 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
|
|
@@ -17832,6 +17537,8 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
var item = new s(l);
|
|
|
item.momentTour = info.momentTour
|
|
|
+ item.dontRot = info.dontRot
|
|
|
+ item.rotTime = info.rotTime
|
|
|
container.push(item)
|
|
|
return item
|
|
|
}
|
|
@@ -18231,39 +17938,23 @@ window.Modernizr = function(n, e, t) {
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- n.prototype.createHotItem = function() {
|
|
|
- var docFragment = document.createDocumentFragment();
|
|
|
-
|
|
|
- this.hotGroup.children.forEach(hot=>{
|
|
|
- if(hot.info.actionType.openHot){/* hot.texType == 'shine' */
|
|
|
- var li = document.createElement('li');
|
|
|
- var span = document.createElement('span');
|
|
|
- span.innerHTML = hot.info.title || '热点';
|
|
|
- // console.log(span.innerHTML);
|
|
|
- li.hot = hot; // 列表每一项对应一个热点
|
|
|
- li.appendChild(span);
|
|
|
- docFragment.appendChild(li);
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- var ul = document.querySelector('#hotListContent ul');
|
|
|
- ul.appendChild(docFragment);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
|
|
|
- /* n.prototype.loadOverlays = function(overlays){
|
|
|
- var overlays = window.data2 && window.data2.overlays
|
|
|
-
|
|
|
-
|
|
|
- overlays && overlays.forEach((info)=>{
|
|
|
- new Overlay(info)
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
- Overlay.load()
|
|
|
- }
|
|
|
- */
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
n.prototype.loadhots = function() {//xzw
|
|
|
initHot(this)
|
|
@@ -18297,7 +17988,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
new Hot(info, 'byOverlay')
|
|
|
})
|
|
|
}
|
|
|
- this.createHotItem( );
|
|
|
+ Hot.createHotList();
|
|
|
Hot.startLoad()
|
|
|
|
|
|
|
|
@@ -19588,7 +19279,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
,
|
|
|
n.prototype.build1 = function() {
|
|
|
- this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
|
|
|
+ this.floor = this.floor || this.model.floors.get(this.floorIndex) || (this.model.floors.list.length == 1 ? this.model.floors.list[0] : this.raycastToFindFloor()) || this.model.getFloorAtPoint(this.position),
|
|
|
this.floor.addPano(this),
|
|
|
this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
|
|
|
this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
|
|
@@ -21479,17 +21170,20 @@ window.Modernizr = function(n, e, t) {
|
|
|
, s = new r.Vector3
|
|
|
, h = new r.Vector3
|
|
|
, u = function(e, t) {
|
|
|
+ //导览速度
|
|
|
var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
|
|
|
- , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
|
|
|
+ // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
|
|
|
+ , r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime;
|
|
|
+
|
|
|
h.copy(A.FORWARD),
|
|
|
this.player.getDirection(h),
|
|
|
s.copy(t).sub(e.position).normalize();
|
|
|
var l = s.dot(h)
|
|
|
, u = Math.acos(l)
|
|
|
, d = u / r;
|
|
|
- return d > n && (r *= d / n,
|
|
|
- u < o && (r *= a)),
|
|
|
- r
|
|
|
+ d > n && (r *= d / n,
|
|
|
+ u < o && (r *= a))
|
|
|
+ return r / DATA.tourWalkSpeed * 100 // 改
|
|
|
};
|
|
|
return function(e, t, i) {
|
|
|
if (this.warpInterrupted)
|
|
@@ -22160,30 +21854,7 @@ 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
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -22308,26 +21979,22 @@ 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)
|
|
|
- } */
|
|
|
-
|
|
|
- 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)),
|
|
@@ -22350,17 +22017,13 @@ 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));
|
|
|
- }
|
|
|
+ //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
|
|
|
+
|
|
|
}
|
|
|
,
|
|
|
n.prototype.onMouseDown = function(e) {
|
|
@@ -22667,11 +22330,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.updateHotVisible()
|
|
|
Hot.updateVisibles([this.currentPano])
|
|
|
this.modeTran = "panorama-panorama"
|
|
|
- setTimeout(()=>{
|
|
|
- for(var i in this.model.hots){
|
|
|
- this.model.hots[i].updateTitle()
|
|
|
- }
|
|
|
- },1000)
|
|
|
+
|
|
|
return this.mode = u.PANORAMA,
|
|
|
e.floor.enter(this.mode),
|
|
|
this.emit(w.PanoChosen, this.currentPano, this.currentPano),
|
|
@@ -23087,7 +22746,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
e.cameraChanged = !a;
|
|
|
|
|
|
if(e.cameraChanged){//
|
|
|
- e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4)
|
|
|
+ e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4) || !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix)
|
|
|
}else e.cameraChanged2 = false
|
|
|
|
|
|
|
|
@@ -23772,8 +23431,8 @@ window.Modernizr = function(n, e, t) {
|
|
|
|
|
|
|
|
|
n.prototype.fastForwardActivePanoFlight = function(e) {
|
|
|
- e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
|
|
|
- y.adjustSpeed(V.FlyToPano, e),
|
|
|
+ e = e || f.transition.fastForwardFactor / 10 * 4 + 1
|
|
|
+ y.adjustSpeed(V.FlyToPano, e)
|
|
|
y.adjustSpeed(V.LookTransition, e)
|
|
|
}
|
|
|
,
|
|
@@ -23798,7 +23457,7 @@ 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);
|
|
@@ -24020,6 +23679,7 @@ 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
|
|
@@ -24385,30 +24045,39 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.history.invalidate();
|
|
|
this.path.discardSlow();
|
|
|
//xzw:
|
|
|
+ var defaultRotTime = DATA.tourRotTime * 1000
|
|
|
+ var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
|
|
|
+
|
|
|
var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
|
|
|
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
|
|
|
- rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;
|
|
|
+ var hasMusic = currentLocation && currentLocation.musicInfo.music
|
|
|
+ if(hasMusic){
|
|
|
+ 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.musicInfo.time - current
|
|
|
|
|
|
- if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
|
|
|
- var timeEachItem = 2000;//假设每个item飞的时间
|
|
|
- var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
|
|
|
-
|
|
|
+ if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
|
|
|
+
|
|
|
+ rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ rotTime = defaultRotTime
|
|
|
}
|
|
|
rotTime = Math.max(0, rotTime)
|
|
|
- console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current)
|
|
|
+ Log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation.musicInfo.time) : ''),"#E8E")
|
|
|
}else{
|
|
|
rotTime = currentLocation.rotTime * 1000
|
|
|
- console.log("rotTime "+rotTime +" at item "+this.director.currentItem)
|
|
|
+ Log("rotTime "+rotTime +" at item "+this.director.currentItem,"#E8E")
|
|
|
}
|
|
|
+
|
|
|
|
|
|
this.path.waitNextStep(e, function() {
|
|
|
t && t()
|
|
|
}.bind(this), rotTime)
|
|
|
}
|
|
|
- ,
|
|
|
+ ,
|
|
|
n.prototype.stopInterlude = function() {
|
|
|
this.interruptAndFastForward(null, 0)
|
|
|
}
|
|
@@ -26929,7 +26598,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
blur: 0.8,
|
|
|
movementEasing: "easeInOutQuad",
|
|
|
blendEasing: "easeInOutQuad",
|
|
|
- fastForwardFactor: 3//r.valueFromHash("mfis", 3)
|
|
|
+ fastForwardFactor: 4,//r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
|
|
|
},
|
|
|
show360Views: {
|
|
|
enabled: !0,
|
|
@@ -31374,8 +31043,10 @@ window.Modernizr = function(n, e, t) {
|
|
|
}).sort(function(e, t) {
|
|
|
return t.score - e.score;
|
|
|
});
|
|
|
- }
|
|
|
-
|
|
|
+ } ,
|
|
|
+ getFileNameFromUrl:function(url){
|
|
|
+ return url.split('/').pop();
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
Math.sign = function(e) {
|