浏览代码

旋转问题

xzw 4 年之前
父节点
当前提交
c17af8c882
共有 2 个文件被更改,包括 39 次插入22 次删除
  1. 18 7
      edit-backstage/js/main_2020_edit.js
  2. 21 15
      web/public/static/js/main_2020_show.js

+ 18 - 7
edit-backstage/js/main_2020_edit.js

@@ -4850,7 +4850,7 @@ function o(a, s, l) {
                             s = this.arrivedAtDestination.bind(this, !0)
                              
                             //add
-                            if(a.zoom && a.zoom != this.player.zoomLevel){
+                            if(o1=='black' && a.zoom && a.zoom != this.player.zoomLevel){
                                 this.player.smoothZoomFovTo(null, a.zoom,  r.warp.teleportTime) //瞬间过渡的时间
                             }
                             
@@ -4867,11 +4867,12 @@ function o(a, s, l) {
                         this.emit("update.controls")
                     }
                 }else{
-                    //add
-                    var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
+                   
+                    //add 原地旋转时, 写到_warpCameraAim里,因那有时间
+                    /* var a = this.model.getHeroDescriptorByIndex(this.destinationItem)
                     if(a.zoom && a.zoom != this.player.zoomLevel){
                         this.player.smoothZoomFovTo(null, a.zoom,  r.warp.teleportTime) //瞬间过渡的时间
-                    }
+                    } */
                     
                     this.arrivedAtDestination(!0)
                 }
@@ -19927,7 +19928,12 @@ function o(a, s, l) {
                     void n.lookAt(u))
                 }
                 .bind(this);
-                return a > D.warp.minRotation ? V.start(d, e, t, 0, B[D.warp.movementEasing]) : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
+                return a > D.warp.minRotation ? (V.start(d, e, t, 0, B[D.warp.movementEasing])
+                   , (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时  
+                    this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
+                ) 
+
+                : (H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim"),
                 void (t && t()))
             }
             ,
@@ -20220,6 +20226,11 @@ function o(a, s, l) {
                             skipWarpingCheck: !1,
                             constantMoveSpeed: !0
                         };
+                        
+                        if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
+                            n.zoomLevel = this.warpDestHeroLoc.zoom 
+                        } 
+                        
                         n.duration = function(e, t) {
                             var i = Math.min(this.player.position.distanceTo(e.position), D.transition.flytimeMaxDistanceThreshold) * D.transition.flytimeDistanceMultiplier + D.transition.flyTime;
                             s.copy(U.FORWARD),
@@ -21980,7 +21991,7 @@ function o(a, s, l) {
                 l = e.skipWarpingCheck, c = e.constantMoveSpeed, h = null, u = null 
                 
                 if (aim){
-                    var m = (new B.Matrix4).lookAt(n.position, r, T.UP)
+                    var m = (new B.Matrix4).lookAt(n.position, aim, T.UP)
                     aimQua = (new B.Quaternion).setFromRotationMatrix(m)  
                 }
                 else aimQua = aimQua 
@@ -21998,7 +22009,7 @@ function o(a, s, l) {
                 this.updateLastView()
                 if (this.mode !== V.PANORAMA) 
                                                                                                                       
-                    void this.flyToNewMode({
+                    return void this.flyToNewMode({
                         mode: V.PANORAMA,
                         pano: n,
                         duration: o,

+ 21 - 15
web/public/static/js/main_2020_show.js

@@ -4968,10 +4968,12 @@ window.Modernizr = function(n, e, t) {
                 this.emit("update.controls"),
                 this.player.updateLastView(),
                 !n && this.atDestinationPano()){
+                    /* 
+                    // 原地旋转时, 写到_warpCameraAim里,因那有时间
                     var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
                     if(r.zoom && r.zoom != this.player.zoomLevel){//add
                         this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
-                    }
+                    } */
                     return void this.arrivedAtDestination(!0);
                 }
                 if (this.player.flying || this.player.isWarping())
@@ -4987,20 +4989,16 @@ window.Modernizr = function(n, e, t) {
                                                                                                                                  
                         if(e == 'noMusic'){
                             var aim = new THREE.Vector3(0,0,-1).applyQuaternion(r.quaternion).add(r.position)   
-                            a1 = this.player.flyToPano.bind(this.player, {pano: this.model.panos.index[r.panoId], lookAtPoint: aim }, this.actionComplete.bind(this))
+                            a1 = this.player.flyToPano.bind(this.player, {zoomLevel: r.zoom  ,  pano: this.model.panos.index[r.panoId], lookAtPoint: aim }, this.actionComplete.bind(this))
                         }else{
-                            var s1 = this.getMomentTour(this.destinationItem)   //window.MP_PREFETCHED_MODELDATA.momentTour || "walk";
-                            a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow,  s1, true, i, this.actionComplete.bind(this)),
+                            var s = this.getMomentTour(this.destinationItem)   //window.MP_PREFETCHED_MODELDATA.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)
-                        }
-                        
                         
-                        
-                        if(r.zoom && r.zoom != this.player.zoomLevel){//add
-                            this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
-                                                                                                                                                                       
+                            if(s=='black' &&  r.zoom && r.zoom != this.player.zoomLevel){//add
+                                this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
+                            }
                         }
-                    
                                                                     
                     
                     } else{
@@ -20949,8 +20947,11 @@ window.Modernizr = function(n, e, t) {
                     void n.lookAt(A))
                 }
                 .bind(this);
-                return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) : (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
-                
+                return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
+                    ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) &&  //add 原地转向最终方位时 
+                    this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
+                ): 
+                (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
                 ,void (t && t())
                 )
             }
@@ -21299,6 +21300,11 @@ window.Modernizr = function(n, e, t) {
                             skipWarpingCheck: !1,
                             constantMoveSpeed: !0
                         };
+                        
+                        if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
+                            n.zoomLevel = this.warpDestHeroLoc.zoom 
+                        } 
+                        
                         n.duration = u.call(this, e, t),
                         this.player.nonInterruptingFlyToPano(n, i)
                     } else
@@ -23290,8 +23296,8 @@ window.Modernizr = function(n, e, t) {
                   , p = null 
                 
                 if (aim){ 
-                    var _ = (new r.Matrix4).lookAt(i.position, n, d.UP)
-                    aimQua = (new r.Quaternion).setFromRotationMatrix(_)
+                    var _ = (new r.Matrix4).lookAt(i.position, aim, d.UP)
+                    aimQua = (new r.Quaternion).setFromRotationMatrix(_) 
                 }
                 else aimQua = aimQua