|
@@ -15389,6 +15389,8 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.quaternion || (this.quaternion = new THREE.Quaternion().setFromEuler(this.rotation))
|
|
|
this.isSprite = d.isSprite
|
|
|
this.noAction = d.noAction
|
|
|
+ this.linkType = d.linkType || "common"
|
|
|
+
|
|
|
this.link = d.link;
|
|
|
this.model = model;
|
|
|
this.size = d.size;
|
|
@@ -15401,7 +15403,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.changeTex()
|
|
|
|
|
|
this.setVisiblePanos(d.visiblePanos);
|
|
|
-
|
|
|
+ this.infoAttribute = d.infoAttribute;
|
|
|
}
|
|
|
var r = e("three")
|
|
|
, f = e("../shaders")
|
|
@@ -15535,10 +15537,92 @@ window.Modernizr = function(n, e, t) {
|
|
|
return null
|
|
|
}
|
|
|
return g && g.length > 0 && g[0].pano
|
|
|
- },
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- hot.prototype.examine = function(e, hotListSta) {
|
|
|
+ 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.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(!player.currentPano)return;
|
|
|
var hotPop = document.getElementById('popup');
|
|
|
//获取那个热点的链接
|
|
@@ -15555,11 +15639,8 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
if(g_tourAudio)g_tourAudio.pause()
|
|
|
|
|
|
- //给热点后面加上随机数,让热点确保是最新的
|
|
|
- var hotLinkParameter = this.link.substring(this.link.indexOf("html")+4);
|
|
|
- //如果热点的内容是英文版的
|
|
|
- var lang = manage.number("lang") == "en" ? "&lang="+ manage.number("lang") : "" ;
|
|
|
- hotLinkParameter.indexOf("?") == -1 ? myElement.src = this.link + "?time="+randomTime().getTime() + "&id=" + window.number +lang : myElement.src = this.link + "&time="+randomTime().getTime() + "&id=" + window.number + lang;
|
|
|
+ var src = getLink(this.link )
|
|
|
+ myElement.src = src;
|
|
|
myElement.id = "id1";
|
|
|
myElement.allowTransparency = "true";
|
|
|
// myElement.scrolling = "no";
|
|
@@ -17282,7 +17363,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.supportedModes[c.TRANSITIONING] = !0,
|
|
|
this.supportsTiles = this.configureTiling(),
|
|
|
// this.supportsVR = t.is_vr,
|
|
|
- this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || true; // 方奕卓 VR功能可配置
|
|
|
+ this.supportsVR = window.MP_PREFETCHED_MODELDATA.supportsVR || false//true; // 方奕卓 VR功能可配置
|
|
|
this.mode = c.DOLLHOUSE,
|
|
|
this.size = null,
|
|
|
this.center = null,
|
|
@@ -19494,7 +19575,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.UP = A.UP.clone(),
|
|
|
this.longestStep = 0,
|
|
|
this.upcomingTransType = null,
|
|
|
- this.burnsDir = 1,
|
|
|
+ this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
|
|
|
this.prevNextDist = 0,
|
|
|
this.nextI = 0,
|
|
|
this.activeTransType = null,
|
|
@@ -20249,16 +20330,16 @@ window.Modernizr = function(n, e, t) {
|
|
|
p.start(u, i, h, 0, d.easeInOutQuad, "wait")
|
|
|
|
|
|
//zoom动画
|
|
|
-
|
|
|
+ //这是啥?
|
|
|
var currentGuide = player.model.heroLocations[app.director.currentItem];
|
|
|
-
|
|
|
- this.player.zoomEnabled = true;
|
|
|
- var zoom = function(e, d) {
|
|
|
- this.player.zoomTo(e * currentGuide.zoom.toFixed(2), true)
|
|
|
+ if(currentGuide.zoom){
|
|
|
+ this.player.zoomEnabled = true;
|
|
|
+ var zoom = function(e, d) {
|
|
|
+ this.player.zoomTo(e * currentGuide.zoom.toFixed(2), true)
|
|
|
|
|
|
- }.bind(this)
|
|
|
- p.start(zoom, 2000, null, 0, d.easeOutQuad, "zoom")
|
|
|
-
|
|
|
+ }.bind(this)
|
|
|
+ p.start(zoom, 2000, null, 0, d.easeOutQuad, "zoom")
|
|
|
+ }
|
|
|
}
|
|
|
,
|
|
|
n.prototype.warpToNonPano = function(e) {
|
|
@@ -20324,8 +20405,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
,
|
|
|
n.prototype._warpCameraAim = function(e, t) {
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
var i = this.warpDestHeroLoc.quaternion
|
|
|
, n = this.playerControls.cameras[a.PANORAMA]
|
|
|
, o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
|
|
@@ -21672,9 +21752,11 @@ window.Modernizr = function(n, e, t) {
|
|
|
//window.DownInterface && new DownInterface().state(this,Hot);
|
|
|
window.Hotpoint && new Hotpoint().state(this,Hot);
|
|
|
}
|
|
|
- if(!this.overlayInitedPlay /* && !settings.isEdit */ && this.overlayGroup.children.length){
|
|
|
- this.overlayGroup.children.forEach((overlay)=>{overlay.plane.material.map.image.play()})
|
|
|
- this.overlayInitedPlay = true
|
|
|
+ if( this.overlayGroup.children.length){
|
|
|
+ this.overlayGroup.children.forEach((overlay)=>{
|
|
|
+ overlay.overlayType == "video" /* && overlay.inSight */&& overlay.plane.material.map.image.play()
|
|
|
+ })
|
|
|
+ //this.overlayInitedPlay = true
|
|
|
}
|
|
|
}
|
|
|
,
|
|
@@ -21823,6 +21905,13 @@ window.Modernizr = function(n, e, t) {
|
|
|
if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ //add
|
|
|
+ this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
return this.mode = u.PANORAMA,
|
|
|
e.floor.enter(this.mode),
|
|
|
this.emit(w.PanoChosen, this.currentPano, this.currentPano),
|
|
@@ -21947,11 +22036,35 @@ window.Modernizr = function(n, e, t) {
|
|
|
i.lookAt(o.add(n.position));
|
|
|
break;
|
|
|
case u.DOLLHOUSE:
|
|
|
- var a = this.position.clone();
|
|
|
+ /* var a = this.position.clone();
|
|
|
this.mode === u.PANORAMA ? a.add(new r.Vector3(0,6,0)).add(this.getDirection().multiplyScalar(-10)) : a.add(d.DOWN.clone().applyQuaternion(this.quaternion).multiplyScalar(6)).setY(6),
|
|
|
n.position.copy(a),
|
|
|
i.target.copy(this.target.clone().setY(this.model.center.y));
|
|
|
- break;
|
|
|
+ break; */
|
|
|
+ //for多楼层 且 让模型刚好适应屏幕
|
|
|
+ var box = this.model.boundingBox.clone();
|
|
|
+ box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
|
|
|
+ var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
|
|
|
+
|
|
|
+ var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
|
|
|
+ var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
|
|
|
+
|
|
|
+ console.log(boxSize.x,distance, boxSize.length() / 2)
|
|
|
+
|
|
|
+ distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
|
|
|
+
|
|
|
+ if(this.mode === u.PANORAMA){
|
|
|
+ i.target.copy(this.model.center);
|
|
|
+ var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
|
|
|
+ }else{
|
|
|
+ i.target.copy(this.target.clone().setY(this.model.center.y))
|
|
|
+ var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
|
|
|
+ }
|
|
|
+
|
|
|
+ vec.multiplyScalar(distance )
|
|
|
+ n.position.copy(i.target.clone().add(vec))
|
|
|
+
|
|
|
+ break
|
|
|
case u.FLOORPLAN:
|
|
|
n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
|
|
|
i.target.copy(this.model.center).setY(0),
|
|
@@ -21976,8 +22089,15 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.intersectHot && this.intersectHot.showTitle()
|
|
|
for(var i in this.model.hots){
|
|
|
this.model.hots[i].update(this.camera)
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+ /* if(e.cameraChanged){
|
|
|
+ this.controlVideosPlay()
|
|
|
+ } */
|
|
|
+
|
|
|
+
|
|
|
this.model.supportsTiles && (this.updateTileDownloader(t),
|
|
|
this.updatePanoRenderer(t)),
|
|
|
this.updatePreRendering(t),
|
|
@@ -21989,6 +22109,57 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.model.supportsTiles && this.updateZoomPano()
|
|
|
}
|
|
|
}(),
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
|
|
|
+ var lastMode, lastPano;
|
|
|
+ return function(){
|
|
|
+ var mode = this.mode;
|
|
|
+ var pano = mode == "panorama" ? this.currentPano : "";
|
|
|
+
|
|
|
+ if(mode != "panorama" || pano != lastPano){
|
|
|
+ overlay.noBlock = null
|
|
|
+ }
|
|
|
+
|
|
|
+ this.overlayGroup.children.forEach((overlay)=>{
|
|
|
+ if(overlay.overlayType == "video" ){
|
|
|
+ var matrix = overlay.plane.matrixWorld;
|
|
|
+ var inSight = false;
|
|
|
+ var cameraDir = this.getDirection();
|
|
|
+ var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
|
|
|
+ var vertexes = []
|
|
|
+ if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
|
|
|
+ for(let i=0; i<4; i++){
|
|
|
+ var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
|
|
|
+ vertexes.push(vertex)
|
|
|
+ if(overlay.noBlock == null){
|
|
|
+ if(!m.ifShelter(vertex)){
|
|
|
+ overlay.noBlock = true
|
|
|
+ }
|
|
|
+ inSight = true; break;
|
|
|
+ }else{
|
|
|
+ overlay.noBlock = true
|
|
|
+ }
|
|
|
+
|
|
|
+ if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
|
|
|
+
|
|
|
+ inSight = true; break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ overlay.inSight = inSight
|
|
|
+ if(!inSight)overlay.plane.material.map.image.pause()
|
|
|
+ else overlay.plane.material.map.image.play()//maybe fail
|
|
|
+ }
|
|
|
+ })
|
|
|
+ lastMode = mode, lastPano = pano
|
|
|
+ }
|
|
|
+ }() */
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
n.prototype.updatePersistentZooming = function(e) {
|
|
|
1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
|
|
|
}
|
|
@@ -22083,7 +22254,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
,
|
|
|
n.prototype.hasChanged = function(e) {
|
|
|
- if (!this.previousState)
|
|
|
+ /* if (!this.previousState)
|
|
|
return this.previousState = {
|
|
|
allFloorsVisible: this.model.allFloorsVisible,
|
|
|
position: this.position.clone(),
|
|
@@ -22125,7 +22296,65 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.previousState.modelPosition.copy(this.model.position),
|
|
|
this.previousState.modelCenter.copy(this.model.center),
|
|
|
this.previousState.zoomLevel = this.zoomLevel,
|
|
|
- !t
|
|
|
+ !t */
|
|
|
+
|
|
|
+ if (!this.previousState)
|
|
|
+ {
|
|
|
+ this.previousState = {
|
|
|
+ allFloorsVisible: this.model.allFloorsVisible,
|
|
|
+ position: this.position.clone(),
|
|
|
+ quaternion: this.quaternion.clone(),
|
|
|
+ mouse: this.mouse.clone(),
|
|
|
+ //labelScaleFactor: this.getLabelScaleFactor(),
|
|
|
+ currentFloor: this.model.currentFloor,
|
|
|
+ projectionMatrix: this.camera.projectionMatrix.clone(),
|
|
|
+ worldMatrix: this.camera.matrixWorld.clone(),
|
|
|
+ mode: this.mode,
|
|
|
+ modelPosition: this.model.position.clone(),
|
|
|
+ modelCenter: this.model.center.clone(),
|
|
|
+ zoomLevel: this.zoomLevel
|
|
|
+ };
|
|
|
+ return !0;
|
|
|
+ }
|
|
|
+ //许钟文改 分成相机是否改变cameraChanged 和其他
|
|
|
+ var a = this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion)&& this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.mode === this.previousState.mode && this.zoomLevel === this.previousState.zoomLevel && this.model.center.equals(this.previousState.modelCenter) && this.model.position.equals(this.previousState.modelPosition)
|
|
|
+ var t = a && this.mouse.equals(this.previousState.mouse) && this.model.allFloorsVisible === this.previousState.allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ && this.model.currentFloor === this.previousState.currentFloor && null === this.nextPano ;
|
|
|
+ e.cameraChanged = !a;
|
|
|
+
|
|
|
+ /* if(!t){//主要判断相机是否旋转
|
|
|
+ e.cameraChanged2 = !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 4)
|
|
|
+ }else e.cameraChanged2 = false */
|
|
|
+
|
|
|
+
|
|
|
+ e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
|
|
|
+ e.moved = !this.position.equals(this.previousState.position),
|
|
|
+ e.rotated = !this.quaternion.equals(this.previousState.quaternion),
|
|
|
+ e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
|
|
|
+ // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
|
|
|
+ e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
|
|
|
+ e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
|
|
|
+ e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
|
|
|
+ e.modeChanged = this.mode !== this.previousState.mode,
|
|
|
+ e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
|
|
|
+ e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
|
|
|
+ e.nextPanoActive = null !== this.nextPano,
|
|
|
+ e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
|
|
|
+
|
|
|
+ this.previousState.allFloorsVisible = this.model.allFloorsVisible,
|
|
|
+ this.previousState.position.copy(this.position),
|
|
|
+ this.previousState.quaternion.copy(this.quaternion),
|
|
|
+ this.previousState.mouse.copy(this.mouse),
|
|
|
+ //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
|
|
|
+ this.previousState.currentFloor = this.model.currentFloor,
|
|
|
+ this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
|
|
|
+ this.previousState.worldMatrix.copy(this.camera.matrixWorld),
|
|
|
+ this.previousState.mode = this.mode,
|
|
|
+ this.previousState.modelPosition.copy(this.model.position),
|
|
|
+ this.previousState.modelCenter.copy(this.model.center),
|
|
|
+ this.previousState.zoomLevel = this.zoomLevel;
|
|
|
+ //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
|
|
|
+
|
|
|
+ return !t
|
|
|
}
|
|
|
,
|
|
|
n.prototype.updateIntersect = function() {
|
|
@@ -22143,8 +22372,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
,
|
|
|
n.prototype.checkHotClick = function() {
|
|
|
if(this.intersectHot){
|
|
|
-
|
|
|
- this.intersectHot.noAction || this.intersectHot.examine(this);
|
|
|
+ this.intersectHot.noAction || this.intersectHot.examine(this)
|
|
|
|
|
|
|
|
|
|
|
@@ -22335,11 +22563,18 @@ window.Modernizr = function(n, e, t) {
|
|
|
n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
|
|
|
//if(urlHasValue('oldEntry')){
|
|
|
//搬自一代。
|
|
|
- var n = d.FORWARD.clone().applyQuaternion(i)
|
|
|
+ var maxY = this.model.boundingBox.max.y;
|
|
|
+ var n = d.FORWARD.clone().applyQuaternion(i)
|
|
|
, i = n.clone().add(e);
|
|
|
this.cameraControls.activeControl.target.copy(i),
|
|
|
- this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(e).add(n.multiplyScalar(-10))
|
|
|
- //return;
|
|
|
+ this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
|
|
|
+ //return;
|
|
|
+
|
|
|
+ /* //this.camera.position.copy(this.model.center);
|
|
|
+ //this.camera.updateMatrixWorld()
|
|
|
+ this.switchCameraMode("dollhouse", i) */
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
|
|
|
//直接用一代的这个 效果和二代几乎一样,且不会甩
|
|
@@ -22518,6 +22753,9 @@ window.Modernizr = function(n, e, t) {
|
|
|
|
|
|
//---------before fly--------------- add
|
|
|
this.updateHotVisible(i); //更新热点显示
|
|
|
+ this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
|
|
|
+
|
|
|
+
|
|
|
//地标变化
|
|
|
if(this.model.floorLogos){
|
|
|
this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
|
|
@@ -22566,6 +22804,60 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
}
|
|
|
,
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ window._transitionPosId = 9999
|
|
|
+
|
|
|
+ n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
|
|
|
+
|
|
|
+ y.cancelById(_transitionPosId)
|
|
|
+
|
|
|
+ var begin = function(object, pos, qua, scale){
|
|
|
+ if(pos){
|
|
|
+ if(!same(object.position, pos, 0.01)){
|
|
|
+
|
|
|
+ y.start(v.vector(object.position, pos), o.dur, (e)=>{
|
|
|
+
|
|
|
+ },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!same(object.quaternion, qua, 1e-6)){
|
|
|
+ y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
|
|
|
+
|
|
|
+ },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(!same(object.scale, scale, 0.001)){
|
|
|
+ y.start(v.vector(object.scale, scale), o.dur, (e)=>{
|
|
|
+
|
|
|
+ },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var same = function(vec1, vec2, diff){
|
|
|
+ var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
|
|
|
+ if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
|
|
|
+ return s
|
|
|
+ }
|
|
|
+ this.overlayGroup.children.forEach(overlay=>{
|
|
|
+ var panoData = o.pano != void 0 && overlay.transformAtPanos[o.pano.id]
|
|
|
+ var useCustom = o.type == "beforeFlyOut" || !panoData
|
|
|
+ var pos = useCustom ? overlay.posCustom : panoData.pos;
|
|
|
+ var qua = useCustom ? overlay.quaCustom : panoData.qua;
|
|
|
+ var scale = useCustom ? overlay.getScaleBySize(overlay.widthCustom, overlay.heightCustom) :
|
|
|
+ overlay.getScaleBySize(panoData.width , panoData.height)
|
|
|
+ scale = new THREE.Vector3(scale.x, scale.y, overlay.scale.z)
|
|
|
+ begin(overlay, pos, qua, scale )
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
n.prototype.fastForwardActivePanoFlight = function(e) {
|
|
|
e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
|
|
|
y.adjustSpeed(V.FlyToPano, e),
|
|
@@ -22875,6 +23167,12 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if(i == "panorama"){
|
|
|
+ this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
|
|
|
+ }else{
|
|
|
+ this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
|
|
|
+ }
|
|
|
+
|
|
|
//------------------------------------
|
|
|
|
|
|
|
|
@@ -25773,7 +26071,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
softBendTilt: 4,
|
|
|
softBendEnd: .3,
|
|
|
doBurns: true, //r.valueFromHash("kb", !0),
|
|
|
- burnsAngle: 8,
|
|
|
+ burnsAngle: 8, //导览在每个点停留时的旋转角度
|
|
|
minBurnsAngle: 35,
|
|
|
minDownAngle: -35,
|
|
|
maxTurnPerSec: 280,
|
|
@@ -29673,6 +29971,35 @@ window.Modernizr = function(n, e, t) {
|
|
|
"use strict";
|
|
|
function n(e, t) {
|
|
|
var i = r(t);
|
|
|
+
|
|
|
+
|
|
|
+ var replaceAll = function (str, f, e) {
|
|
|
+ //f全部替换成e
|
|
|
+ var reg = new RegExp(f, "g"); //创建正则RegExp对象
|
|
|
+ return str.replace(reg, e);
|
|
|
+ };
|
|
|
+ var urlFirstView = c.valueFromHash('firstView');
|
|
|
+ if(urlFirstView){
|
|
|
+ try{
|
|
|
+ urlFirstView = replaceAll(urlFirstView, "pano", '"pano"')
|
|
|
+ urlFirstView = replaceAll(urlFirstView, "qua:", '"qua":[')
|
|
|
+ urlFirstView = "{"+urlFirstView+"]}"
|
|
|
+ let info = JSON.parse(urlFirstView);
|
|
|
+ i.pano = t.list[info.pano] //panos.get(info.pano)
|
|
|
+ if(!i.pano){
|
|
|
+ urlFirstView = false
|
|
|
+ console.error('检测到firstView但是 找不到该pano')
|
|
|
+ }else{
|
|
|
+ i.quaternion = new THREE.Quaternion().fromArray(info.qua)
|
|
|
+ i.zoom = -1;
|
|
|
+ i.mode = "panorama"
|
|
|
+ i.setByUrl = true
|
|
|
+ }
|
|
|
+ }catch(e){
|
|
|
+ urlFirstView = false
|
|
|
+ console.error('检测到firstView但是解析出错'+e)
|
|
|
+ }
|
|
|
+ }
|
|
|
if (Object.keys(i).length > 0)
|
|
|
return i;
|
|
|
if (e.heroImage)
|
|
@@ -30688,7 +31015,9 @@ window.Modernizr = function(n, e, t) {
|
|
|
isLoaded: function(e) {
|
|
|
return !!a[e]
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
+ window.Texture = t.exports
|
|
|
}
|
|
|
, {
|
|
|
"../settings": 166,
|