|
@@ -4755,17 +4755,17 @@ window.Modernizr = function(n, e, t) {
|
|
|
.bind(this))
|
|
|
}
|
|
|
,
|
|
|
- n.prototype.atDestinationPano = function() {
|
|
|
- if (!this.player.currentPano || null === this.destinationItem)
|
|
|
- return !1;
|
|
|
- var e = this.player.currentPano.id;
|
|
|
- if (void 0 === e)
|
|
|
- return !1;
|
|
|
- var t = this.model.heroLocations;
|
|
|
- //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
|
|
|
+ n.prototype.atDestinationPano = function(pano) {
|
|
|
+ if(null === this.destinationItem)return !1;
|
|
|
+
|
|
|
+ pano = pano || this.player.currentPano
|
|
|
|
|
|
+ if(!pano){
|
|
|
+ return !1;
|
|
|
+ }
|
|
|
+
|
|
|
var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
|
|
|
- return destination && destination.panoId == e
|
|
|
+ return destination && destination.panoId == pano.id
|
|
|
}
|
|
|
,
|
|
|
n.prototype.redirectToItem = function(e, t) {
|
|
@@ -4925,7 +4925,7 @@ window.Modernizr = function(n, e, t) {
|
|
|
|
|
|
|
|
|
|
|
|
- n.prototype.findNearestItem = function(){//找到离currentPano最近的导览
|
|
|
+ n.prototype.findNearestItem = function(endToStart=true){//找到离currentPano最近的导览
|
|
|
var result = {item:[0,0], dis:Infinity};
|
|
|
var compare = (location, item)=>{
|
|
|
if(location.panoId != void 0 && location.panoId!= "outside"){
|
|
@@ -4939,12 +4939,9 @@ window.Modernizr = function(n, e, t) {
|
|
|
} */
|
|
|
if(this.currentItem && Math.abs(item[0]-this.currentItem[0]) < Math.abs(result.item[0]-this.currentItem[0])){
|
|
|
result.item = item, result.dis = dis
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
this.model.heroLocations.forEach((e,i)=>{
|
|
|
if(e.heroLocations){
|
|
@@ -4959,6 +4956,13 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
|
|
|
})
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if(endToStart && this.atEndOfTour(result.item)){ //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
|
|
|
+ return [0,0]
|
|
|
+ }
|
|
|
+
|
|
|
return result.item
|
|
|
|
|
|
}
|
|
@@ -5128,13 +5132,12 @@ window.Modernizr = function(n, e, t) {
|
|
|
|
|
|
|
|
|
|
|
|
- n.prototype.atEndOfTour = function() {
|
|
|
- //return this.currentItem >= this.nItems - 1
|
|
|
- var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
|
|
|
+ n.prototype.atEndOfTour = function(currentItem=this.currentItem) {
|
|
|
+ var end = currentItem && currentItem[0] >= this.nItems - 1;
|
|
|
if(end){
|
|
|
var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
|
|
|
if(heroLocations){
|
|
|
- end = this.currentItem[1] >= heroLocations.length - 1
|
|
|
+ end = currentItem[1] >= heroLocations.length - 1
|
|
|
}
|
|
|
}
|
|
|
return end;
|
|
@@ -5149,7 +5152,6 @@ window.Modernizr = function(n, e, t) {
|
|
|
//return 0 < this.nItems ? this.nItems - 1 : null
|
|
|
return 0 < this.nItems ? [this.nItems - 1,0]: null
|
|
|
}
|
|
|
-
|
|
|
,
|
|
|
|
|
|
n.prototype.goPrev = function() {
|
|
@@ -16042,8 +16044,8 @@ window.Modernizr = function(n, e, t) {
|
|
|
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)),
|
|
|
+ i.push(p.filters.inPanoDirection(l, h, c)),
|
|
|
o.push(p.scoreFunctions.direction(l, h))
|
|
|
}
|
|
|
var u = new r.Vector3
|
|
@@ -17604,10 +17606,28 @@ window.Modernizr = function(n, e, t) {
|
|
|
return e
|
|
|
},
|
|
|
set: function(t) {
|
|
|
- e = t,
|
|
|
- this.chunks.forEach(function(t) {
|
|
|
- t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
|
|
|
- })
|
|
|
+ e = t
|
|
|
+ //console.log(t)
|
|
|
+ this.chunks.forEach(function(chunk) {
|
|
|
+ if (chunk.material && chunk.material.uniforms.modelAlpha) {
|
|
|
+ chunk.material.uniforms.modelAlpha.value = e
|
|
|
+ //修改一下defines,为了在不需要map时不加载map。 by xzw
|
|
|
+ /* if (e>0) {
|
|
|
+ if (!('useModelMap' in chunk.material.defines)) {
|
|
|
+ chunk.material.defines.useModelMap = ''
|
|
|
+ chunk.material.needsUpdate = true
|
|
|
+ console.log('add useModelMap')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if ('useModelMap' in chunk.material.defines) {
|
|
|
+ delete chunk.material.defines.useModelMap
|
|
|
+ chunk.material.needsUpdate = true
|
|
|
+ chunk.material.uniforms.map.value.dispose() //防止崩溃(但是因为这样飞出要等待时间所以被去掉了)
|
|
|
+ console.log('delete useModelMap')
|
|
|
+ }
|
|
|
+ } */
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -22978,15 +22998,14 @@ window.Modernizr = function(n, e, t) {
|
|
|
if (!this.currentPano)
|
|
|
return;
|
|
|
t.push(s.filters.not(this.currentPano)),
|
|
|
- t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
|
|
|
t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
|
|
|
+ t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
|
|
|
t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
|
|
|
t.push(s.filters.isNotBehindNormal(e.point, e.normal))
|
|
|
} else{
|
|
|
- t.push((pano)=>{ // add
|
|
|
- return this.checkHasNeighbor(pano)
|
|
|
- })
|
|
|
t.push(s.filters.isOnVisibleFloor()),
|
|
|
+ t.push(this.checkHasNeighbor)//add
|
|
|
+
|
|
|
this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
|
|
|
}
|
|
|
var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
|
|
@@ -23185,6 +23204,10 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
.bind(this),
|
|
|
!this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
var C = function(e) {
|
|
|
t && t(e)
|
|
|
}
|
|
@@ -23260,46 +23283,58 @@ window.Modernizr = function(n, e, t) {
|
|
|
this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
|
|
|
}
|
|
|
//=======================================
|
|
|
-
|
|
|
+ this.nextPano = i
|
|
|
|
|
|
- aimQua && y.start(function(e) {
|
|
|
- S.copy(b),
|
|
|
- v.quaternion(S, aimQua)(e),
|
|
|
- M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
|
|
|
- this.cameraControls.activeControl.lookAt(M)
|
|
|
- }
|
|
|
- .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
|
|
|
- var B = c ? null : A[f.transition.movementEasing];
|
|
|
- this.nextPano = i,
|
|
|
- y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
|
|
|
- y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
|
|
|
- y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
|
|
|
- this.flying = !1,
|
|
|
- this.currentPano !== i && this.currentPano.exit(),
|
|
|
- i.enter(),
|
|
|
- this.currentPano = i,
|
|
|
- this.nextPano = null,
|
|
|
- this.path.placeCpm(),
|
|
|
- this.path.fadeOutCpm(f.path.fadeOutTime),
|
|
|
- this.spider.draw(),
|
|
|
- this.emit(w.FlyingEnded, i.position, L, i, D),
|
|
|
- this.updateMarkerVisi(),//add
|
|
|
- C(e)
|
|
|
+ let beginTran = ()=>{
|
|
|
+ aimQua && y.start(function(e) {
|
|
|
+ S.copy(b),
|
|
|
+ v.quaternion(S, aimQua)(e),
|
|
|
+ M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
|
|
|
+ this.cameraControls.activeControl.lookAt(M)
|
|
|
+ }
|
|
|
+ .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
|
|
|
+ var B = c ? null : A[f.transition.movementEasing];
|
|
|
|
|
|
- //add:
|
|
|
- if(this.mode == "panorama" ){
|
|
|
- if(this.model.floorLogos){
|
|
|
- this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
|
|
|
- //this.model.adjustfloorLogoHeight()
|
|
|
- this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
|
|
|
- this.model.floorLogos[1].visible = false;
|
|
|
- }
|
|
|
+ y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
|
|
|
+ y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
|
|
|
+ y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
|
|
|
+ this.flying = !1,
|
|
|
+ this.currentPano !== i && this.currentPano.exit(),
|
|
|
+ i.enter(),
|
|
|
+ this.currentPano = i,
|
|
|
+ this.nextPano = null,
|
|
|
+ this.path.placeCpm(),
|
|
|
+ this.path.fadeOutCpm(f.path.fadeOutTime),
|
|
|
+ this.spider.draw(),
|
|
|
+ this.emit(w.FlyingEnded, i.position, L, i, D),
|
|
|
+ this.updateMarkerVisi(),//add
|
|
|
+ C(e)
|
|
|
|
|
|
- this.model.fadePanoMarkers()//add
|
|
|
- Hot.updateVisibles([this.currentPano])//add
|
|
|
+ //add:
|
|
|
+ if(this.mode == "panorama" ){
|
|
|
+ if(this.model.floorLogos){
|
|
|
+ this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
|
|
|
+ //this.model.adjustfloorLogoHeight()
|
|
|
+ this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
|
|
|
+ this.model.floorLogos[1].visible = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.model.fadePanoMarkers()//add
|
|
|
+ Hot.updateVisibles([this.currentPano])//add
|
|
|
+ }
|
|
|
}
|
|
|
+ .bind(this), 0, B, "camFly", V.FlyToPano)
|
|
|
}
|
|
|
- .bind(this), 0, B, "camFly", V.FlyToPano)
|
|
|
+
|
|
|
+
|
|
|
+ if(!this.model.supportsTiles && i.getSkyboxTexture().image[0].width > 1024){
|
|
|
+ setTimeout(()=>{
|
|
|
+ beginTran()
|
|
|
+ },16) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
|
|
|
+ }else{
|
|
|
+ beginTran()
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
,
|
|
@@ -23535,7 +23570,14 @@ window.Modernizr = function(n, e, t) {
|
|
|
t || (t = 0),
|
|
|
n = void 0 !== n ? n : .75;
|
|
|
var o = r ? "angle" : "direction";
|
|
|
- return this.model.panos.findRankedByScore(t, [s.filters.isPanoAligned(), s.filters.inPanoDirection(this.position, i, n), s.filters.isNeighbourPanoTo(this.currentPano), s.filters.not(this.currentPano)], [s.scoreFunctions.distanceSquared(this.currentPano), s.scoreFunctions[o](this.position, i)], e),
|
|
|
+ return this.model.panos.findRankedByScore(t,
|
|
|
+ [s.filters.isPanoAligned(),
|
|
|
+ s.filters.not(this.currentPano),
|
|
|
+ s.filters.isNeighbourPanoTo(this.currentPano),
|
|
|
+ s.filters.inPanoDirection(this.position, i, n)],
|
|
|
+
|
|
|
+ [s.scoreFunctions.distanceSquared(this.currentPano),
|
|
|
+ s.scoreFunctions[o](this.position, i)], e),
|
|
|
this.cachedPanoCandidates = e.candidates,
|
|
|
e.pano
|
|
|
}
|
|
@@ -23807,137 +23849,152 @@ window.Modernizr = function(n, e, t) {
|
|
|
window.bus.dispatchEvent({type:'playerAndModelReady'})
|
|
|
this.ready = true
|
|
|
//------------------------------------
|
|
|
+
|
|
|
+ var beginTran = ()=>{
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- var _ = (new r.Vector3).copy(this.position);
|
|
|
- if (i === u.PANORAMA){
|
|
|
- this.emit(w.PanoChosen, n, n),
|
|
|
- setTimeout(function() {
|
|
|
- n.floor.enter(i)
|
|
|
- }
|
|
|
- .bind(this), I / 2),
|
|
|
- this.path.fadeOutCpm(f.path.fadeOutTime);
|
|
|
|
|
|
- if(this.model.floorLogos){
|
|
|
- this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
|
|
|
- this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
|
|
|
- }
|
|
|
|
|
|
- }else if (i === u.DOLLHOUSE) {
|
|
|
- if (h && (this.model.stayPut = !0),
|
|
|
- a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
|
|
|
- this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
|
|
|
- this.path.placeCpm(),
|
|
|
+ var _ = (new r.Vector3).copy(this.position);
|
|
|
+ if (i === u.PANORAMA){
|
|
|
+ this.emit(w.PanoChosen, n, n),
|
|
|
+ setTimeout(function() {
|
|
|
+ n.floor.enter(i)
|
|
|
+ }
|
|
|
+ .bind(this), I / 2),
|
|
|
+ this.path.fadeOutCpm(f.path.fadeOutTime);
|
|
|
+
|
|
|
+ if(this.model.floorLogos){
|
|
|
+ this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
|
|
|
+ this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if (i === u.DOLLHOUSE) {
|
|
|
+ if (h && (this.model.stayPut = !0),
|
|
|
+ a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
|
|
|
+ this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
|
|
|
+ this.path.placeCpm(),
|
|
|
+ this.path.fadeInCpm(f.path.fadeInTime),
|
|
|
+ h) {
|
|
|
+ var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
|
|
|
+ _.set(15, 10, 15);
|
|
|
+ var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
|
|
|
+ , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
|
|
|
+ , P = R.intersectObjects([this.sceneIntersectionPlane]);
|
|
|
+ P.length ? (T.copy(P[0].point),
|
|
|
+ _.copy(a.position),
|
|
|
+ this.cameraControls.controls[u.DOLLHOUSE].resetRanges(.75 * _.distanceTo(T), !0)) : (F.warn("Tried to restore dollhouse mode that did not intersect...", a.position, a.quaternion),
|
|
|
+ this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
|
|
|
+ this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
|
|
|
+ _.add(this.model.position),
|
|
|
+ C.position.copy(_),
|
|
|
+ this.cameraControls.controls[u.DOLLHOUSE].update()
|
|
|
+ }
|
|
|
+ } else if (this.path.placeCpm(),
|
|
|
this.path.fadeInCpm(f.path.fadeInTime),
|
|
|
- h) {
|
|
|
- var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
|
|
|
- _.set(15, 10, 15);
|
|
|
- var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
|
|
|
- , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
|
|
|
- , P = R.intersectObjects([this.sceneIntersectionPlane]);
|
|
|
- P.length ? (T.copy(P[0].point),
|
|
|
- _.copy(a.position),
|
|
|
- this.cameraControls.controls[u.DOLLHOUSE].resetRanges(.75 * _.distanceTo(T), !0)) : (F.warn("Tried to restore dollhouse mode that did not intersect...", a.position, a.quaternion),
|
|
|
- this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
|
|
|
- this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
|
|
|
- _.add(this.model.position),
|
|
|
- C.position.copy(_),
|
|
|
- this.cameraControls.controls[u.DOLLHOUSE].update()
|
|
|
- }
|
|
|
- } else if (this.path.placeCpm(),
|
|
|
- this.path.fadeInCpm(f.path.fadeInTime),
|
|
|
- a) {
|
|
|
- this.model.warpDestFloors(a.floorVisibility);
|
|
|
- var O = this.cameraControls.cameras[u.FLOORPLAN]
|
|
|
- , L = this.cameraControls.controls[u.FLOORPLAN]
|
|
|
- , D = O.position.clone().sub(L.target)
|
|
|
- , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
|
|
|
- , U = Math.atan2(B.x, B.z);
|
|
|
- L.target.copy(a.position);
|
|
|
- var k = D.length();
|
|
|
- L.offset.x = k * Math.sin(U),
|
|
|
- L.offset.y = 0,
|
|
|
- L.offset.z = k * Math.cos(U),
|
|
|
- O.position.copy(L.target).add(L.offset);
|
|
|
- L.target.clone().sub(C.position);
|
|
|
- C.quaternion.copy(a.quaternion),
|
|
|
- L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
|
|
|
- L.absoluteScale = L.currentScale,
|
|
|
- L.update()
|
|
|
- } else
|
|
|
- this.model.currentFloor.enter(i);
|
|
|
- var H = this.currentPano
|
|
|
- , G = this.position.clone();
|
|
|
- return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
|
|
|
- this.flying = !0,
|
|
|
- this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
|
|
|
- C.controls.target.set(this.model.center.x, 0, this.model.center.z),
|
|
|
- C.controls.update()),
|
|
|
- e.blackoutStyle = S.FADEIN,
|
|
|
- I = f.show360Views.transitionTime,
|
|
|
- this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
|
|
|
- this.mode = i,
|
|
|
- this.path && this.path.popOutCpm(),
|
|
|
- e.blackoutStyle = S.END,
|
|
|
- I = f.show360Views.transitionTime,
|
|
|
- this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
|
|
|
- y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
|
|
|
- y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
|
|
|
- y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
|
|
|
- y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
|
|
|
- y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
|
|
|
- y.setTimeout(function() {
|
|
|
- this.flying = !1,
|
|
|
- p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
|
|
|
- this.currentPano.enter(),
|
|
|
- this.path.placeCpm(),
|
|
|
- this.path.fadeOutCpm(f.path.fadeOutTime),
|
|
|
- this.spider.draw()),
|
|
|
- p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
|
|
|
+ a) {
|
|
|
+ this.model.warpDestFloors(a.floorVisibility);
|
|
|
+ var O = this.cameraControls.cameras[u.FLOORPLAN]
|
|
|
+ , L = this.cameraControls.controls[u.FLOORPLAN]
|
|
|
+ , D = O.position.clone().sub(L.target)
|
|
|
+ , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
|
|
|
+ , U = Math.atan2(B.x, B.z);
|
|
|
+ L.target.copy(a.position);
|
|
|
+ var k = D.length();
|
|
|
+ L.offset.x = k * Math.sin(U),
|
|
|
+ L.offset.y = 0,
|
|
|
+ L.offset.z = k * Math.cos(U),
|
|
|
+ O.position.copy(L.target).add(L.offset);
|
|
|
+ L.target.clone().sub(C.position);
|
|
|
+ C.quaternion.copy(a.quaternion),
|
|
|
+ L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
|
|
|
+ L.absoluteScale = L.currentScale,
|
|
|
+ L.update()
|
|
|
+ } else
|
|
|
+ this.model.currentFloor.enter(i);
|
|
|
+ var H = this.currentPano
|
|
|
+ , G = this.position.clone();
|
|
|
+ this.emit(w.FlyingStarted, _, G, n, this.currentPano),
|
|
|
+ this.flying = !0,
|
|
|
+ this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
|
|
|
+ C.controls.target.set(this.model.center.x, 0, this.model.center.z),
|
|
|
+ C.controls.update()),
|
|
|
+ e.blackoutStyle = S.FADEIN,
|
|
|
+ I = f.show360Views.transitionTime,
|
|
|
+ this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
|
|
|
this.mode = i,
|
|
|
- this.emit(w.FlyingEnded, _, G, this.currentPano, H)
|
|
|
-
|
|
|
- //add:
|
|
|
- this.updateMarkerVisi() ;
|
|
|
- //(this.mode == u.PANORAMA) && this.updateHotVisible(),
|
|
|
- this.mode == u.PANORAMA&&this.model.floorLogos&&(
|
|
|
- this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
|
|
|
- this.model.floorLogos[0].visible = true
|
|
|
- )
|
|
|
-
|
|
|
- if (this.afterCModeFuc) {
|
|
|
- //手动加的函数
|
|
|
- var cf = this.afterCModeFuc;
|
|
|
- this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
|
|
|
- cf();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if(this.mode == u.PANORAMA){
|
|
|
- Hot.updateVisibles([this.currentPano])
|
|
|
- this.model.fadePanoMarkers()
|
|
|
- }else{
|
|
|
- Hot.updateVisibles(true)
|
|
|
- this.model.hotGroup.children.forEach(overlay=>{
|
|
|
- if(overlay.animateInfo){
|
|
|
- GifTexDeal.start(overlay.animation)
|
|
|
- }
|
|
|
- })
|
|
|
+ this.path && this.path.popOutCpm(),
|
|
|
+ e.blackoutStyle = S.END,
|
|
|
+ I = f.show360Views.transitionTime,
|
|
|
+ this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
|
|
|
+ y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
|
|
|
+ y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
|
|
|
+ y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
|
|
|
+ y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
|
|
|
+ y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
|
|
|
+ y.setTimeout(function() {
|
|
|
+ this.flying = !1,
|
|
|
+ p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
|
|
|
+ this.currentPano.enter(),
|
|
|
+ this.path.placeCpm(),
|
|
|
+ this.path.fadeOutCpm(f.path.fadeOutTime),
|
|
|
+ this.spider.draw()),
|
|
|
+ p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
|
|
|
+ this.mode = i,
|
|
|
+ this.emit(w.FlyingEnded, _, G, this.currentPano, H)
|
|
|
+
|
|
|
+ //add:
|
|
|
+ this.updateMarkerVisi() ;
|
|
|
+ //(this.mode == u.PANORAMA) && this.updateHotVisible(),
|
|
|
+ this.mode == u.PANORAMA&&this.model.floorLogos&&(
|
|
|
+ this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
|
|
|
+ this.model.floorLogos[0].visible = true
|
|
|
+ )
|
|
|
+
|
|
|
+ if (this.afterCModeFuc) {
|
|
|
+ //手动加的函数
|
|
|
+ var cf = this.afterCModeFuc;
|
|
|
+ this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
|
|
|
+ cf();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(this.mode == u.PANORAMA){
|
|
|
+ Hot.updateVisibles([this.currentPano])
|
|
|
+ this.model.fadePanoMarkers()
|
|
|
+ }else{
|
|
|
+ Hot.updateVisibles(true)
|
|
|
+ this.model.hotGroup.children.forEach(overlay=>{
|
|
|
+ if(overlay.animateInfo){
|
|
|
+ GifTexDeal.start(overlay.animation)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
|
|
|
+ t.resolve())
|
|
|
}
|
|
|
+ .bind(this), I, V.FlyToNewMode)
|
|
|
|
|
|
- h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
|
|
|
- t.resolve())
|
|
|
}
|
|
|
- .bind(this), I, V.FlyToNewMode),
|
|
|
|
|
|
- this.mode = u.TRANSITIONING,
|
|
|
+
|
|
|
+ if( i == "panorama" && !this.model.supportsTiles && n.getSkyboxTexture().image[0].width > 1024){
|
|
|
+ setTimeout(()=>{
|
|
|
+ beginTran()
|
|
|
+ },16) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
|
|
|
+ }else{
|
|
|
+ beginTran()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ this.mode = u.TRANSITIONING
|
|
|
|
|
|
//p == "panorama" && this.updateHotVisible(),
|
|
|
|
|
|
- t.promise()
|
|
|
+ return t.promise()
|
|
|
}
|
|
|
,
|
|
|
n.prototype.fade360View = function(e, t, i) {
|
|
@@ -27380,9 +27437,14 @@ window.Modernizr = function(n, e, t) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
- vec4 colorFromTexture = texture2D( map, vUv );
|
|
|
- colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
|
|
|
+ //#ifdef useModelMap //起不了作用为啥
|
|
|
+ if(modelAlpha>0.0){
|
|
|
+ vec4 colorFromTexture = texture2D( map, vUv );
|
|
|
+ colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
|
|
|
+ }
|
|
|
+ //#endif
|
|
|
+
|
|
|
+
|
|
|
float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
|
|
|
colorFromPanos = mix(colorFromPanos, GREY, whiteness);
|
|
|
|
|
@@ -60219,6 +60281,7 @@ var addMagnifier = function(){
|
|
|
}
|
|
|
|
|
|
|
|
|
+ 展示版导览改为就近导览,所以一开始并非第一个。如果在最后一个点上会自动从头开始
|
|
|
|
|
|
|
|
|
|