xzw 3 năm trước cách đây
mục cha
commit
14e9440453
3 tập tin đã thay đổi với 27 bổ sung13 xóa
  1. 22 9
      js/Hot.js
  2. 2 2
      js/edit.js
  3. 3 2
      js/manage.js

+ 22 - 9
js/Hot.js

@@ -1174,18 +1174,20 @@ window.initHot = function(model){
         
         examine(options={}) {
             var openHot = this.info.link && this.info.actionType.openHot && !options.dontOpen
-            var fastTran = !options.dontFastTran && this.info.actionType.fastTran 
-            if(fastTran){
-                let info = this.info.cameraData 
-                player.blackToPano({
-                    pano: player.model.panos.index[info.pano.uuid],
-                    quaternion: new THREE.Quaternion().fromArray(info.camera.quaternion)
-                })   
+            var fastTran = !options.dontFastTran && ( this.info.actionType.fastTran || settings.hotFastTran || options.fastTran)
+            if(fastTran){//瞬间过渡 1到固定方位 2到和普通过渡一样的位置,也就是最适合的位置
+                let info = this.info.cameraData  
+                if(info){
+                    player.blackToPano({
+                        pano: player.model.panos.index[info.pano.uuid],
+                        quaternion: new THREE.Quaternion().fromArray(info.camera.quaternion)
+                    }) 
+                }                
             }
             
             
             
-            var needExamine = !fastTran && (options.examine || (!settings.dontExamHot && this.info.actionType.examine))
+            var needExamine = !this.info.cameraData && (options.examine || (!settings.dontExamHot && this.info.actionType.examine))
             if(!openHot && !needExamine)return;
             
             
@@ -1310,7 +1312,18 @@ window.initHot = function(model){
                     aimDuration: options.aimDuration,
                     
                 };
-                player.flyToPano(d, done)
+                if(fastTran){
+                    let f = (new THREE.Matrix4).lookAt(c.position, h, new THREE.Vector3(0,1,0));
+                    let quaternion = (new THREE.Quaternion).setFromRotationMatrix(f)
+                    player.blackToPano({
+                        pano:c,
+                        quaternion,
+                    }) 
+                    done()
+                }else{
+                    player.flyToPano(d, done)
+                }
+                
             } else {
                 var p = {
                     pano: c

+ 2 - 2
js/edit.js

@@ -1061,10 +1061,10 @@ Hotpoint.prototype.init = function() {
         player.model.hotGroup.children.forEach(hot=>{
             if(hot.texType == 'shine'){
                 hot.info.scale.multiplyScalar(s)
-                hot.scale.multiplyScalar(s)
+                hot.scale.multiplyScalar(s) 
             }
         })
-        
+        DATA.hotIconScale *= s
         
     })
     

+ 3 - 2
js/manage.js

@@ -85,7 +85,8 @@ var settings = {
     /* flytimeDistanceMultiplier:150, 
     flyTime:750,  */
     tourRotTime:2,  //默认停留2秒
-    //dontExamHot:true  
+    //dontExamHot:true,  
+    hotFastTran:true,
     transparentBg: false,
     bgImg:  null 
 }
@@ -1551,7 +1552,7 @@ var SoundManager = {//暂不支持同时播放
     
     pause:function(name, autoReplayLast, isInterrupt){//需要能自动恢复上一个被打算的音频。恢复前判断是否还需要播放
         var object = this.list.find(e=>e.name == name)
-        if(object){
+        if(object && this.currentAudio == object){
             this.currentAudio = null