ソースを参照

尝试导览时间

xzw 3 年 前
コミット
77e64fef8e
8 ファイル変更374 行追加259 行削除
  1. 7 19
      css/lzb.css
  2. 14 0
      edit.html
  3. BIN
      images/edit/image.png
  4. 14 5
      js/TransformControls.js
  5. 257 152
      js/edit.js
  6. 36 21
      js/main_2020_edit.js
  7. 44 61
      js/main_2020_show.js
  8. 2 1
      js/manage.js

+ 7 - 19
css/lzb.css

@@ -222,32 +222,20 @@ ul li {
 }
 
 .toolRight div.content>ul>li>*:first-child {
-    margin: 3px 0 10px 0;
+    margin: 3px 0 13px 0;
 }
 
 .itemMargin {
     margin: 10px auto !important;
 }
 
-.toolRight .itemTitle {
-    font-size: 14px;
-    display: flex;
-    line-height: 14px;
-    position: relative;
-}
+ 
 
 .toolRight li[data-name=info] .itemTitle {
     margin: 0px 0 !important;
 }
 
-.toolRight .itemTitle::before {
-    position: absolute;
-    right: 0px;
-    top: 2px;
-    content: ""attr(data-size)"";
-    color: #999;
-}
-
+ 
 .toolRight .link input:first-child {
     margin-bottom: 10px;
 }
@@ -363,7 +351,7 @@ ul.MenuOptions li.chosen {
 .toolRight div.content>ul>li {
     border-top: 1px solid #636363;
     border-bottom: 1px solid #000000;
-    padding: 10px;
+    padding: 15px 10px;
 }
 
 .toolRight div.content>ul>li:first-child {
@@ -466,7 +454,7 @@ ul.MenuOptions li.chosen {
 }
 
 #hotpointDetail .editCheckbox{
-    margin-left: 54px;
+    margin-left: 65px;
 } 
 .editCheckbox input:checked+label {
     border: 0;
@@ -771,9 +759,9 @@ ul.MenuOptions li.chosen {
 }
 
 .toolRight .itemTitle {
-    font-size: 14px;
+    font-size: 16px;
     display: flex;
-    line-height: 14px;
+    line-height: 16px;
     position: relative;
 }
 .toolRight li[name="content"]>ul>li .itemTitle{

+ 14 - 0
edit.html

@@ -1615,6 +1615,20 @@
                                             <li class="halfCell chosen" index="black" data-lang="">瞬间</li>
                                         </ul>  
                                     </li>
+                                    <li> 
+                                       
+                                        <div class="itemTitle">
+                                            <span>停留时间(秒)</span>
+                                        </div>
+                                        <ul name='rotTime' class="clearfix ">
+                                            <input class="" type="number" placeholder="若不填写,默认2秒" value="1" max="1000" min="0" step="0.1">
+                                        </ul>        
+                                        <ul name="rotSwitch" class="switch clearfix  ">
+                                            <label><input class="mui-switch mui-switch-animbg" type="checkbox">
+                                                开启旋转 
+                                            </label>
+                                        </ul>
+                                    </li>
                                     <li id="tourRenew" class="info"> 
                                         <div class="name itemMargin">
                                             <div class="buttons begin">

BIN
images/edit/image.png


+ 14 - 5
js/TransformControls.js

@@ -481,7 +481,16 @@ var TransformControls = function ( camera, domElement, options ) {
 					_tempVector2.set( d, d, d );
 				}
 
-			} else {
+			}else if ( axis.search( 'XY' ) !== - 1  ) { //add  等比例for plane
+                var d = pointEnd.length() / pointStart.length();
+
+				if ( pointEnd.dot( pointStart ) < 0 ) d *= - 1;
+ 
+				 
+                _tempVector2.set( d, d, 1 ); 
+            
+            
+            }else {
 
 				_tempVector.copy( pointStart );
 				_tempVector2.copy( pointEnd );
@@ -1045,12 +1054,12 @@ var TransformControlsGizmo = function (options) {
 			[ new Mesh( scaleHandleGeometry, matBlue ), [ 0, 0, 0.8 ], [ Math.PI / 2, 0, 0 ]],
 			[ new Line( lineGeometry, matLineBlue ), null, [ 0, - Math.PI / 2, 0 ], [ 0.8, 1, 1 ]]
 		],
-		/* XY: [
+		XY: [
 			[ new Mesh( scaleHandleGeometry, matYellowTransparent ), [ 0.85, 0.85, 0 ], null, [ 2, 2, 0.2 ]],
 			[ new Line( lineGeometry, matLineYellow ), [ 0.855, 0.98, 0 ], null, [ 0.125, 1, 1 ]],
 			[ new Line( lineGeometry, matLineYellow ), [ 0.98, 0.855, 0 ], [ 0, 0, Math.PI / 2 ], [ 0.125, 1, 1 ]]
 		],
-		YZ: [
+		/* YZ: [
 			[ new Mesh( scaleHandleGeometry, matCyanTransparent ), [ 0, 0.85, 0.85 ], null, [ 0.2, 2, 2 ]],
 			[ new Line( lineGeometry, matLineCyan ), [ 0, 0.855, 0.98 ], [ 0, 0, Math.PI / 2 ], [ 0.125, 1, 1 ]],
 			[ new Line( lineGeometry, matLineCyan ), [ 0, 0.98, 0.855 ], [ 0, - Math.PI / 2, 0 ], [ 0.125, 1, 1 ]]
@@ -1084,10 +1093,10 @@ var TransformControlsGizmo = function (options) {
 		Z: [
 			[ new Mesh( new CylinderBufferGeometry( 0.2, 0, 0.8, 4, 1, false ), matInvisible ), [ 0, 0, 0.5 ], [ Math.PI / 2, 0, 0 ]]
 		],
-		/* XY: [
+		 XY: [
 			[ new Mesh( scaleHandleGeometry, matInvisible ), [ 0.85, 0.85, 0 ], null, [ 3, 3, 0.2 ]],
 		],
-		YZ: [
+		/*YZ: [
 			[ new Mesh( scaleHandleGeometry, matInvisible ), [ 0, 0.85, 0.85 ], null, [ 0.2, 3, 3 ]],
 		],
 		XZ: [

+ 257 - 152
js/edit.js

@@ -19,6 +19,23 @@ function reData(data, type) {
     return JSON.stringify(data) == type ? null : data
 }
 
+let strictInputNum = function(e, precision, min=0,max){//precision:保留小数位数
+    var value = e.target.value.trim(); 
+    var lastOne = value[value.length-1];
+    var preContent = value.substr(0,value.length-1)
+    var hasPoint = precision > 0 && lastOne == '.' ; 
+     
+    var a = Math.pow(10, precision)
+    value = parseFloat(value) || 0;
+    if(isNaN(value)){
+        e.target.value = preContent //还原
+        return
+    }
+    e.target.value =  Math.max(min, parseInt(value * a) / a )
+    
+    hasPoint && (e.target.value += '.')//补小数点
+}
+
 //新编辑界面
 var EditTools = function(n) {
     //main2018 里面的主要对象
@@ -216,7 +233,7 @@ EditTools.prototype.initSaveAll = function() {
                 // 鼠标标志颜色
                 momentTour: $('#tourSwitch input').is(':checked') ? 'black' : 'walk',
                 // 导览瞬间过渡
-                showHotListSta: $('#hotListSwitch input').is(':checked'),
+                showHotListSta: $('#hotListSwitch').is(':checked'),
                 // 开启热点列表
                 hotIconScale: DATA.hotIconScale,
                 // 热点缩放
@@ -230,20 +247,16 @@ EditTools.prototype.initSaveAll = function() {
                 cadBorderWidth: $('#cad-size').val(),
                 showCad: $('input[name="show-cad"]').is(':checked'),
             }
-
-         
-    
-        /* console.log("保存数据");
-        console.log({  
-            guides: reData(guides, '[]'),
-            info: info, 
-        })
-        console.log(JSON.stringify(guides) )    
-             
-             debugger; */
-             
+ 
              
-            
+            var data =  { 
+                sceneCode: number,
+                hots: reData(that.hotpoint.getSavingInfo(), '{}'),
+                name: number,
+                guides: reData(guides, '[]'),
+                info: info, 
+            } 
+            console.log(data)
             let url = cmp ? ('/api/scene/edit/' + cmp) : '/manage/scene/edit'
             $.ajax({
                 method: 'POST',
@@ -254,15 +267,7 @@ EditTools.prototype.initSaveAll = function() {
                 dataType: 'json',
                 contentType: 'application/json',
                 url: ceshi + url,
-                data: JSON.stringify({ 
-                    sceneCode: number,
-                    hots: reData(that.hotpoint.getSavingInfo(), '{}'),
-                    name: number,
-                    guides: reData(guides, '[]'),
-                    info: info,
-                    //tourAudio: reData(that.editGuide.getTourAudio(), '{}'),
-                    //overlays: reData(overlayInfo, '[]')
-                }),
+                data: JSON.stringify(data),
                 success: function(data) {
                     if (data.code === 0) {//成功
                         //manage.showInfo("保存成功")
@@ -300,9 +305,9 @@ SceneInformation.prototype.init = function(data, data2) {
     /*******************方奕卓 其他项需要用到data来初始化, 故一并放到这里 ******************/
     let momentTour = $('#tourSwitch input');
     // 导览瞬间过渡开关
-    let hotListSwitch = $('#hotListSwitch input');
+    let hotListSwitch = $('#hotListSwitch');
     // 热点列表开关
-    let hotIconScale = $('#hotIconScale input');
+    let hotIconScale = $('#hotIconScale');
     // 热点图标缩放
     let VRSwitch = $('#VRSwitch input');
     // VR功能开启
@@ -651,38 +656,48 @@ Hotpoint.prototype.init = function() {
   
     this.hotpointDetail.find(".tail .submit").on('click', this.saveHot.bind(this))
     
+    {
+        let ui = $('#hotIconScale input')
+        let min = parseFloat(ui.attr('min'));
+        let max = parseFloat(ui.attr('max'));
+        ui.on("change", function(e) {  
+            var s = THREE.Math.clamp(parseFloat(e.target.value), min, max)
+            if(isNaN(s))s = 1
+            e.target.value = s   
+            DATA.hotIconScale = s
+        })
+        
+    }
     
-
-    $('#hotIconScale input').on("change", function(e) {  
-        var s = THREE.Math.clamp(parseFloat(e.target.value), 0.1, 100)
-        e.target.value = s  
-        DATA.hotIconScale = s
+    this.isSpriteCheckBox = new CheckBox({dom:  $("#isSprite"),
+        uiCallBack : (checked)=>{ 
+             
+        },
+        callbackWhenChose:(checked)=>{
+            that.editSpot.info.isSprite = checked;
+            if(checked) {
+                that.editSpot.update(player)
+            }else{  
+                that.editSpot.rotation.copy(that.editSpot.info.rotation)
+            }  
+        }
     })
-    
-    
-    $("#isSprite").on("change", function(e) {
-        that.editSpot.info.isSprite = this.checked;
-        if (this.checked) {
-            that.editSpot.update(player)
-        } else {  
-            that.editSpot.rotation.copy(that.editSpot.info.rotation)
-            /* var curPanoTransform = that.editSpot.transformAtPanos[ getTransformSid()] || {}
-            that.editSpot.plane.quaternion.copy(curPanoTransform.qua || that.editSpot.quaternion)  */
-        } 
-    }) 
-    
-    
-    {//clickEvent
-        let checkboxs = this.hotpointDetail.find("li[name='clickEvent'] li.editCheckbox input");
-        checkboxs.on("change", function(e) {
-            var name = $(this).attr('name')
-            that.editSpot.info.actionType[name] = !!this.checked; 
+      
+    //clickEvent
+    this.actionCheckBox = new CheckBox({dom:  this.hotpointDetail.find("li[name='clickEvent'] li.editCheckbox input"),
+        uiCallBack : (checked, name)=>{ 
             if(name == 'openHot'){
                 var content =  that.hotpointDetail.find("li[name='content']") 
-                this.checked ? content.removeClass('hide') : content.addClass('hide')
-            }
-        })
-    }
+                checked ? content.removeClass('hide') : content.addClass('hide')
+            }  
+        },
+        callbackWhenChose:(checked, name)=>{ 
+            that.editSpot.info.actionType[name] = !!checked; 
+            
+        }
+    })
+ 
+ 
      
      
     //点击添加热点按钮
@@ -734,7 +749,7 @@ Hotpoint.prototype.init = function() {
         }
             
        
-        player.model.hotGroup.children.forEach(hot=>{//还原所有同时修改了的贴图和模型
+        this.tempInfos && player.model.hotGroup.children.forEach(hot=>{//还原所有同时修改了的贴图和模型
             var info = this.tempInfos[hot.sid] 
             if(hot.texType == 'shine'){
                 hot.changeTexType(hot.texType,   info.styleImg  )
@@ -780,9 +795,23 @@ Hotpoint.prototype.init = function() {
     })
    
     
+    this.panoTransformCheckBox = new CheckBox({dom: $('#setPosForPano input') ,
+        uiCallBack : (checked, name)=>{ 
+               
+        },
+        callbackWhenChose:(checked, name)=>{ 
+            if(!checked){
+                delete this.editSpot.info.transformAtPanos[getTransformSid()]  
+                this.editSpot.position.copy(this.editSpot.info.position)
+                //this.editSpot.quaternion.copy(this.editSpot.quaternion) 
+            }else{
+                this.getTransformAtPano('position') 
+            } 
+            
+        }
+    })
     
-    
-    $('#setPosForPano input').on("change", ()=>{
+    /* $('#setPosForPano input').on("change", ()=>{
         var on = $('#setPosForPano input').is(':checked') 
         if(!on){
             delete this.editSpot.info.transformAtPanos[getTransformSid()]  
@@ -791,11 +820,13 @@ Hotpoint.prototype.init = function() {
         }else{
             this.getTransformAtPano('position') 
         }
-    })  
+    })  */ 
     
     
     //是否显示模型线框
     this.wireframeModel = new THREE.Object3D;
+     
+    
     $('#wireframeSwitch input').on('change',(e)=>{
         var visi = e.target.checked;
         if(visi && this.wireframeModel.children.length == 0){
@@ -823,47 +854,40 @@ Hotpoint.prototype.init = function() {
     
     
     //动画
-    $("#gifSwitch input").on("change",  (e)=>{
-        var on = e.target.checked
-        $("#gifInfoEdit").css({display: on ? 'block' : 'none'})
-        if(on){
-            that.editSpot.info.animateInfo = {
-                cellXcount : parseInt($("#gifXCount").val()),
-                cellYcount : parseInt($("#gifYCount").val()),
-                voidCount : parseInt($("#voidCount").val()), 
-                loop : true,
-                duration : parseFloat($("#gifDuration").val()) * 1000
-            }  
-            that.editSpot.animation = GifTexDeal.addAnimation(that.editSpot.material_.map, that.editSpot, this.editSpot.info.animateInfo, this.editSpot.sid)       
-            GifTexDeal.start(that.editSpot.animation)
-        }else{
-            GifTexDeal.remove(that.editSpot.animation) 
-            that.editSpot.info.animateInfo = null
+    
+    this.gifCheckBox = new CheckBox({dom: $("#gifSwitch input"),
+        uiCallBack : (checked )=>{  
+            $("#gifInfoEdit").css({display: checked ? 'block' : 'none'})
+            
+        },
+        callbackWhenChose:(checked )=>{ 
+            if(checked){
+                that.editSpot.info.animateInfo = {
+                    cellXcount : parseInt($("#gifXCount").val()),
+                    cellYcount : parseInt($("#gifYCount").val()),
+                    voidCount : parseInt($("#voidCount").val()), 
+                    loop : true,
+                    duration : parseFloat($("#gifDuration").val()) * 1000
+                }  
+                that.editSpot.animation = GifTexDeal.addAnimation(that.editSpot.material_.map, that.editSpot, this.editSpot.info.animateInfo, this.editSpot.sid)       
+                GifTexDeal.start(that.editSpot.animation)
+            }else{
+                GifTexDeal.remove(that.editSpot.animation) 
+                that.editSpot.info.animateInfo = null
+            }
+            
         }
-    })  
+    })
+
+    
+   
 
     
     {//gif动画  input
         
-        let strictInputNum = function(e, precision, min=0,max){//precision:保留小数位数
-            var value = e.target.value.trim(); 
-            var lastOne = value[value.length-1];
-            var preContent = value.substr(0,value.length-1)
-            var hasPoint = precision > 0 && lastOne == '.' ; 
-             
-            var a = Math.pow(10, precision)
-            value = parseFloat(value) || 0;
-            if(isNaN(value)){
-                e.target.value = preContent //还原
-                return
-            }
-            e.target.value =  Math.max(min, parseInt(value * a) / a )
-            
-            hasPoint && (e.target.value += '.')//补小数点
-        }
         let changeAnimation = function(){
-            GifTexDeal.setRepeart(that.editSpot.animation)
-           
+            GifTexDeal.setRepeart(that.editSpot.animation.animation)
+            that.useSuitableRatio()
         }
         let restartAnimation = function(){
             GifTexDeal.stop(that.editSpot.animation)
@@ -973,8 +997,8 @@ Hotpoint.prototype.init = function() {
         $("#voidCount").on('change',(e)=>{
             strictInputNum(e, 0);
             that.editSpot.info.animateInfo.voidCount = parseInt(e.target.value)
-            changeFrameCount()
-            changeAnimation()
+            changeFrameCount() 
+            restartAnimation()
         }) 
          
          
@@ -1023,12 +1047,12 @@ Hotpoint.prototype.init = function() {
                 this.hotpointDetail.find('[name=boxDepthPanel]').removeClass('hide')
                 this.updateBoxDepthPanel()
                 this.hotpointDetail.find('[name=uploadObj]').addClass('hide')
-                
+                transformControls.unableScaleZ() 
                 
             }else{
                 this.hotpointDetail.find('[name=boxDepthPanel]').addClass('hide')
                 this.hotpointDetail.find('[name=uploadObj]').removeClass('hide')
-                //transformControls.enableScaleZ() 
+                  
                 
             }
             
@@ -1100,28 +1124,17 @@ Hotpoint.prototype.editHot = function(hot, $li) {
     this.getTempInfo(hot)
     hot.visible = true
        
-        
-        
-
-     
-    this.updatePano()
-    
+         
      
-    
+    this.updatePano() 
     this.updateListSelect(hot);
      
-     
-    
-    /* if(hot.infoAttribute.hotIconScale){
-        $("#hotpointDetail .scale .MenuOptions li[index=user]").click()
-    }else $("#hotpointDetail .scale .MenuOptions li[index=default]").click() */
-    
-    
-    $("#isSprite")[0].checked = this.editSpot.isSprite
-    
-    /* this.hotpointDetail.find(".MenuOptions[name='linkType'] li").removeClass("chosen")
-    this.hotpointDetail.find(".MenuOptions[name='linkType'] li[index = " + this.editSpot.linkType+"]").addClass("chosen") 
-     */
+      
+    //$("#isSprite")[0].checked = this.editSpot.info.isSprite
+    this.isSpriteCheckBox.updateChoseAtUI(this.editSpot.info.isSprite)
+   
+   
+   
     this.linkTypeMenuOptions.updateChoseAtUI({name:this.editSpot.info.linkType})
      
      
@@ -1181,19 +1194,24 @@ Hotpoint.prototype.getTempInfo = function(hot) { //  编辑前, 从当前状
     hot.tempInfo.media = hot.texMedia
     hot.tempInfo.objObject = hot.objObject
     
-    this.tempInfos = {}
     
-    player.model.hotGroup.children.forEach(hot=>{
-        this.tempInfos[hot.sid] = {
-            styleImg :  hot.styleImg,
-            texMedia : hot.texMedia,
-            objObject : hot.objObject,
-            scale : hot.scale.clone()
-        } 
-    }) 
+    this.getTempInfos() 
 } 
 
-
+Hotpoint.prototype.getTempInfos = function(){
+    if(Hot.allPhotoLoaded && Hot.allModelLoaded){
+        this.tempInfos = {}
+        
+        player.model.hotGroup.children.forEach(hot=>{
+            this.tempInfos[hot.sid] = {
+                styleImg :  hot.styleImg,
+                texMedia : hot.texMedia,
+                objObject : hot.objObject,
+                scale : hot.scale.clone()
+            } 
+        }) 
+    }
+}
 
 Hotpoint.prototype.getTransformAtPano = function(type){
     /* var name = getTransformSid()
@@ -1216,7 +1234,7 @@ Hotpoint.prototype.getTransformAtPano = function(type){
 }  
 
 Hotpoint.prototype.updateTransform = function(type){
-    var on = $('#setPosForPano input').is(':checked')
+    var on = this.panoTransformCheckBox.checked() //$('#setPosForPano input').is(':checked')
     //var name = getTransformSid()
     if(on && type == 'position'){ 
         this.getTransformAtPano(type) 
@@ -1235,8 +1253,8 @@ Hotpoint.prototype.updateTransform = function(type){
 
 Hotpoint.prototype.updatePano = function(){
     if(!this.editSpot ) return;
-    $('#setPosForPano input').prop('checked', !!this.editSpot.info.transformAtPanos[getTransformSid()]);
-    
+    //$('#setPosForPano input').prop('checked', !!this.editSpot.info.transformAtPanos[getTransformSid()]);
+    this.panoTransformCheckBox.updateChoseAtUI(!!this.editSpot.info.transformAtPanos[getTransformSid()])
 }
 
  
@@ -1544,12 +1562,13 @@ Hotpoint.prototype.initListSelect = function(){//热点样式图列表
                 div.css("background-image", 'url("'+media.src+'")')
                 //应用到热点:
                 if(!o.dontApplyToHot){ 
-                    this.editSpot.changeTexType("photo", media || 'clear' ) 
-                    this.useSuitableRatio( )
-                    this.updateGifPanel({animateInfo: this.photoList.chosenItem[0].animateInfo })  
+                    this.editSpot.changeTexType("photo", media || 'clear' )  
+                    this.updateGifPanel({animateInfo: this.photoList.chosenItem[0].animateInfo }) 
+                    this.useSuitableRatio()                    
                 }else{
                     this.updateGifPanel({on: !!this.photoList.chosenItem[0].animateInfo  })    
                 }
+                
                 //$('#gifEdit').removeClass('hide');
                 
             }else{
@@ -1955,7 +1974,7 @@ Hotpoint.prototype.initListSelect = function(){//热点样式图列表
                   
                 this.texLists[editItemInfo.type].addNew()
                 this.texLists[editItemInfo.type].selectFromOutSide(editItemInfo.$li.index()) 
-                    
+                this.texLists[editItemInfo.type].listDom.addClass('hide')     
             }
         }, "photo", e);
     
@@ -2078,6 +2097,7 @@ Hotpoint.prototype.initListSelect = function(){//热点样式图列表
     this.hotpointDetail.find(" li[name=style] .itemTitle").attr('data-size','') 
     if(this.editSpot){//已经在编辑了,初始化下
         this.updateListSelect(this.editSpot)
+        this.getTempInfos()  
     }
     
     this.hotpointDetail.find(" li[name=setPos] button[name=setSpace] ").on('click',(e)=>{
@@ -2113,6 +2133,7 @@ Hotpoint.prototype.switchModel = function(o={}){
             transformControls.enableScaleZ()
         }  
     }else if(o.remove){
+        //如果没有出现plane,很可能是因为背面朝向镜头了!
         o.spot.addPlane()
         if(o.spot == this.editSpot)  transformControls.unableScaleZ()        
     }
@@ -2186,8 +2207,9 @@ Hotpoint.prototype.updateGifPanel = function(o={}){
     
      
     if(o.on != void 0){
-        $("#gifSwitch input").prop('checked', o.on);
-        $("#gifInfoEdit").css({display: o.on ? 'block' : 'none'})
+        
+        this.gifCheckBox.updateChoseAtUI(o.on)
+        
         
         GifTexDeal.remove(hot.animation)
         if(o.on){
@@ -2280,6 +2302,7 @@ Hotpoint.prototype.updateListSelect = function(hot) { //每次开始编辑热点
         if(hasModel){
             var info = this.modelList.findChosenByContent(hot.objObject) 
             this.modelList.selectFromOutSide(info.index,  {dontApplyToHot:true})
+            transformControls.enableScaleZ()
         }
     }
     
@@ -2315,6 +2338,14 @@ Hotpoint.prototype.useSuitableRatio = function(o={}) {//自适应素材比例
                 mediaW = hot.texMedia.width;
                 mediaH = hot.texMedia.height;
                 //动画的话再变
+                
+                
+                if(hot.info.animateInfo){
+                    mediaW /= hot.info.animateInfo.cellXcount
+                    mediaH /= hot.info.animateInfo.cellYcount
+                }
+                
+                
             }else{
                 mediaW = hot.texMedia.videoWidth || hot.videoWidth || 1;
                 mediaH = hot.texMedia.videoHeight || hot.videoHeight || 1;
@@ -2343,7 +2374,7 @@ Hotpoint.prototype.useSuitableRatio = function(o={}) {//自适应素材比例
 
 Hotpoint.prototype.updateClickEventUI = function() {//根据actionType更新ui
     var hot = this.editSpot;  
-    var checkboxs = this.hotpointDetail.find("li[name='clickEvent'] li.editCheckbox");
+    /* var checkboxs = this.hotpointDetail.find("li[name='clickEvent'] li.editCheckbox");
     checkboxs.addClass('hide');
     
     for(let i in hot.info.actionType){
@@ -2353,7 +2384,13 @@ Hotpoint.prototype.updateClickEventUI = function() {//根据actionType更新ui
     } 
     
     var content =  this.hotpointDetail.find("li[name='content']") 
-    hot.info.actionType.openHot  ? content.removeClass('hide') : content.addClass('hide')
+    hot.info.actionType.openHot  ? content.removeClass('hide') : content.addClass('hide') */
+    
+    for(let i in hot.info.actionType){
+        this.actionCheckBox.updateChoseAtUI(hot.info.actionType[i], i)
+        
+    }
+    
 }
 
 //添加图片和视频
@@ -2584,6 +2621,7 @@ Hotpoint.prototype.addHot = function(that) {
         scale: new THREE.Vector3(s,s,0.02),
         actionType : CloneObject(settings.hotClickEvent[g_HotStatus])
     });
+    hot.photoHasRequestLoad = hot.modelHasRequestLoad = true;//防止requestDownload
     player.model.hots[sid] = hot;
     hot.hasRequestLoad = true
     hot.isNew = true
@@ -2731,6 +2769,7 @@ Hotpoint.prototype.saveHot = function() {
         //获取图片路径
         upload($images, 'images', resolve)
     }).then(function(imgUrls) {
+        $layout.removeClass('hide');
         args.images = imgUrls
         //获取视频路径
         return new Promise(function(resolve, reject) {
@@ -2738,6 +2777,7 @@ Hotpoint.prototype.saveHot = function() {
         }
         )
     }).then(function(videoUrls) {
+        $layout.removeClass('hide');
         args.video = videoUrls
         //获取视频封面路径
         return new Promise(function(resolve, reject) {
@@ -2745,6 +2785,7 @@ Hotpoint.prototype.saveHot = function() {
         }
         )
     }).then(function(thums) {
+        $layout.removeClass('hide');
         args.video = args.video.map(function(video, index) {//整合视频+封面
             return {
                 url: video,
@@ -2754,6 +2795,7 @@ Hotpoint.prototype.saveHot = function() {
     }).then(function() {
         //获取热点音乐所有的路径
         //console.log($miusc)
+        $layout.removeClass('hide');
         if ($miusc[0].files.length > 0) {
             return new Promise(function(resolve) {
                 upload($miusc, 'miusc', function(res) {
@@ -2777,7 +2819,7 @@ Hotpoint.prototype.saveHot = function() {
         var doneNum = 0; 
         var filesNeedSave = [];
         var liNeedSave = [], liNeedSave2 = []
-        
+        $layout.removeClass('hide');
         
         Array.from(that.styleList.listDom.children()).forEach(li=>{
             if(li.sameContentSpots.length == 0)return;//没被热点用到就不保存
@@ -2827,9 +2869,7 @@ Hotpoint.prototype.saveHot = function() {
                                         spot.info.styleImg = li._styleImg.map(img=>img.src)
                                     }else{ 
                                         spot.info.texSrc = li._media.src 
-                                        spot.texMedia.src = li._media.src    // error 跨域
-                                        //spot.texMedia = Texture.load()
-                                        //spot.texMedia.fileSrc = li._media.src 
+                                        spot.texMedia.src = li._media.src  
                                     }
                                 }) 
                             }) 
@@ -2852,6 +2892,7 @@ Hotpoint.prototype.saveHot = function() {
         
          
     }).then(function() {
+        $layout.removeClass('hide');
         //获取热点标题、内容、内嵌网页、模型网页。
         args.title = $title.val()
         args.content = $content.val()
@@ -2948,9 +2989,7 @@ Hotpoint.prototype.getSavingInfo = function(){//保存全部
         hotData.scale = toPrecision(hot.info.scale.toArray(), 3) 
         hotData.rotation = toPrecision(hot.info.rotation.toArray().slice(0,3), 4) 
         hotData.order = index
-        /* if(!hot.texType == 'video'){
-            hotData.fileName = hot.texMedia.name
-        } */
+        
         hotData.transformAtPanos = {}
         for(let i in hot.info.transformAtPanos){ 
             hotData.transformAtPanos[i] = {
@@ -2966,6 +3005,15 @@ Hotpoint.prototype.getSavingInfo = function(){//保存全部
             delete hotData.animateInfo
         }
         
+        
+       
+        hotData.model = hotData.model.length ?  hotData.model : ''  
+        hotData.images = hotData.images.length ?  hotData.images : ''
+        hotData.video = hotData.video.length ?  hotData.video : ''
+        hotData.iframe = hotData.iframe.length ?  hotData.iframe : ''
+        
+         
+        
         hots[hot.sid] = hotData
     })
 
@@ -3226,7 +3274,28 @@ EditGuide.prototype.init = function(data, data2) {
     this.momentMenuOptions = new MenuOptions({ //链接打开方式切换 
         dom: $(" #tourSwitch_Slice ") 
     })
-     
+    
+    
+    
+    this.rotCheckBox = new CheckBox({dom: $('#tourItemEdit [name="rotSwitch"] input') ,
+        uiCallBack : (checked )=>{ 
+               
+        },
+        callbackWhenChose:(checked )=>{  
+            this.editingItemLi.tourData.dontRot = checked ? 0 : 1
+        }
+    })
+    {
+        let ui = $('#tourItemEdit [name="rotTime"] input')
+        let min = parseFloat(ui.attr('min'));
+        let max = parseFloat(ui.attr('max'));
+        ui.on("change", function(e) {  
+            var s = THREE.Math.clamp(parseFloat(e.target.value), min, max)
+            if(isNaN(s))s = ''
+            e.target.value = s   
+            that.editingItemLi.tourData.rotTime = s
+        })
+    }
 }
 
 
@@ -3339,11 +3408,18 @@ EditGuide.prototype.editItem = function(li) {
     $('#tourItemEdit').removeClass('atRight');
     $('#tourItemEdit .tourName input').val( $(li).find('.guide-name').text() );
     
+    $('#tourItemEdit [name="rotTime"] input').val(parseFloat(li.tourData.rotTime))
+    
+    
     var momentTour = li.tourData.momentTour || "default"
     /* $("#tourSwitch_Slice li").removeClass('chosen')
     $("#tourSwitch_Slice li[index="+ momentTour +"]").addClass('chosen'); */
     this.momentMenuOptions.updateChoseAtUI({name:momentTour})
     
+    this.rotCheckBox.updateChoseAtUI(!li.tourData.dontRot)
+    
+    
+    
     var metadata = JSON.parse(li.tourData.metadata);
     if(metadata.scan_id != 'outside'){
         var pano = player.model.panos.index[metadata.scan_id]
@@ -3384,7 +3460,7 @@ EditGuide.prototype.completeFolder = function(){//点击完成
     
     var momentTour = this.momentFolderMenuOptions.getSelectName()//$("#folderTourSwitch li.chosen").attr("index"); 
     this.editingFolderLi.tourData.momentTour = momentTour != 'default' ?  momentTour : null;
-    
+    this.editingFolderLi.tourData.name = tourName
     
     
     this.editingFolderLi.tourItemDoms = Array.from($('#tourItemList ul li'));
@@ -3490,6 +3566,7 @@ EditGuide.prototype.cancelFolder = function(){//放弃编辑
     this.editingFolderLi.tourData = this.editingFolderLi.tempData;//还原
     this.editingFolderLi.tourItemDoms.forEach((e,i)=>{
         e.tourData = this.editingFolderLi.tourData.locations[i]
+        $(e).find('.guide-name').text(e.tourData.name)
         $(e).find('#tourBg')[0].style.backgroundImage = 'url(' + e.tourData.thumbnail_signed_src + ')';
     })
     
@@ -5342,6 +5419,7 @@ var VisiSet = {
             player.model.hots[i].material_.depthTest = false;
             
             player.model.hots[i].position.copy(player.model.hots[i].info.position);//覆盖transformAtPanos
+            player.model.hots[i].update(player)
         }
         this.setDisplay(true)
         this.updateFootIconSize()
@@ -5783,27 +5861,54 @@ class MenuOptions extends ButtonBase{
 
 
 
-class checkBox extends ButtonBase{ 
+
+
+
+
+
+class CheckBox extends ButtonBase{ 
     constructor(o={}){
         super(o)
+        this.dom.on("change",(e)=>{ 
+            var name = $(e.target).attr('name')
+            this.uiCallBack && this.uiCallBack(e.target.checked, name) 
+            this.callbackWhenChose && this.callbackWhenChose(e.target.checked, name)
+        })
+    }
+    
+    updateChoseAtUI(checked, name){
+        var dom  
+        if(name) dom = this.dom.filter('[name='+name+']')[0]
+        else dom = this.dom[0]
+        dom.checked = checked   //this.dom.prop("checked") 
         
+        this.uiCallBack && this.uiCallBack(checked, name) 
+    }
+    
+    checked(name){
+        var dom  
+        if(name) dom = this.dom.filter('[name='+name+']')[0]
+        else dom = this.dom[0]
+        return dom.checked 
     }
 }
 
-class onOffSwitch extends checkBox{
+
+
+
+
+/* class OnOffSwitch extends CheckBox{
     constructor(o={}){
         super(o)
     }
 }
-
+ */
 
 /* 
   待加功能:
   
-  完善onOffSwitch  checkBox几个类
-  
-  平移时增加setSpace("world") 的onOffSwitch
-    
+   
+   
     //boxhelper改成粗线
     
     热点可视时改成一样大小 

+ 36 - 21
js/main_2020_edit.js

@@ -17091,6 +17091,10 @@ function o(a, s, l) {
                         }
                         var item = new p(l);
                         item.momentTour = n.momentTour
+                        item.dontRot = n.dontRot
+                        item.rotTime = n.rotTime
+                        
+                        
                         container.push(item) 
                         return item
                     }
@@ -17465,7 +17469,7 @@ function o(a, s, l) {
                 var docFragment = document.createDocumentFragment();
                 
                 this.hotGroup.children.forEach(hot=>{
-                    if(hot.texType == 'shine'){
+                    if(hot.info.actionType.openHot){
                         var li = document.createElement('li');
                         var span = document.createElement('span');
                         span.innerHTML = hot.info.title || '热点';
@@ -19943,7 +19947,7 @@ function o(a, s, l) {
                     t;
                 var r = this.getHeroDescriptorByHeroIndex(i);
                 if (null === r)
-                    return t;
+                    return t; 
                 if (!r.isPano())
                     return t;
                 function o(e) {
@@ -19969,11 +19973,12 @@ function o(a, s, l) {
             ,
             t.prototype.waitNextStep = function(e, t, i) {
                 var o = null == i ? D.warp.tourStepDelay : i;
-                o = o || (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
+                o = o != void 0? o: (this.lastTransType === L.BLACK ? m.tourStepDelaySlideShow : m.tourStepDelayDefault);
                 var a = new P.Euler
                   , s = new P.Vector3;
                 H.debug("Starting wait: " + (void 0 !== t));
-                var l = this.calcBurnsAmount(e)
+                var currentLocation = this.model.heroLocations[this.director.currentItem[0]] 
+                var l = currentLocation.dontRot || this.calcBurnsAmount(e)
                   , c = function() {
                     this.endWarpState(),
                     this.player.mode === O.DOLLHOUSE && (this.playerControls.cameras[O.DOLLHOUSE].controls.rotationAcceleration.x = 0),
@@ -19985,11 +19990,11 @@ function o(a, s, l) {
                         return c(),
                         !0;
                     var i = t || 1e3 / 60;
-                    if (D.warp.doBurns)
+                    if (D.warp.doBurns && !currentLocation.dontRot )
                         if (this.player.mode === O.PANORAMA) {
                             var n = this.playerControls.cameras[O.PANORAMA];
                             a.setFromQuaternion(n.quaternion, D.warp.eOrder);
-                            var r = i * l / o;
+                            var r = o == 0 ? l : i * l / o;
                             
                             r = Math.sign(r) * Math.max(r, 0.0001) //add  如果音频长的话,使旋转可见,否则以为停住了
                             
@@ -20111,7 +20116,7 @@ function o(a, s, l) {
                     this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
                 
                 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"),
+                : (/* H.info("Aim angle only is " + a.toPrecision(3) + " degrees, skipping explicit re-aim") ,*/
                 void (t && t()))
                 
                 
@@ -21787,8 +21792,9 @@ function o(a, s, l) {
                     /* if(this.mode == 'panorama')this.model.hotGroup&&this.model.hotGroup.children.forEach(overlay=>{
                         overlay.update() 
                     }) */
+                    this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
+                    
                 }
-                this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z },this.cameraControls.controls.panorama.lon);
                 this.model.supportsTiles && (this.updateTileDownloader(F),
                 this.updatePanoRenderer(F)),
                 this.updatePreRendering(F),
@@ -21985,14 +21991,14 @@ function o(a, s, l) {
                         if(editTool.atPanel == 'hotpoint'){
                             var hots = this.model.hotGroup.children
                         }else{
-                            var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.openHot )
+                            var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.openHot || e.info.actionType.playAndPause)
                         }
                          
                         this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
                         if(this.intersect){
                             deal()
                             this.intersectHot && $("#player").css("cursor", "pointer");
-                            return; 
+                         
                         }
                     }  
                 }
@@ -22023,6 +22029,9 @@ function o(a, s, l) {
                             editTool.hotpoint.editHot(this.intersectHot)
                         }  
                     }else{
+                        if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
+                            this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser) 
+                        }
                         this.intersectHot.examine()
                     }
                     
@@ -23082,17 +23091,23 @@ function o(a, s, l) {
                 
                  
                 var currentLocation = this.model.heroLocations[this.director.currentItem[0]] 
-                var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
-                var current = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
-                var rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;  
-                
-                if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
-                    var timeEachItem = 2000;//假设每个item飞的时间
-                    var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
-                     
-                } 
-                rotTime = Math.max(0, rotTime)
-                console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current) 
+                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;  
+                    
+                    if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
+                        var timeEachItem = 2000;//假设每个item飞的时间
+                        var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
+                         
+                    } 
+                    rotTime = Math.max(0, rotTime)
+                    console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current) 
+                }else{
+                    rotTime = currentLocation.rotTime * 1000
+                    console.log("rotTime "+rotTime +" at item "+this.director.currentItem) 
+                }
                  
                 this.path.waitNextStep(e, function() {//等待音乐播放一段时间再下一步,此时镜头会缓慢旋转
                     t && t()

+ 44 - 61
js/main_2020_show.js

@@ -3396,7 +3396,7 @@ window.Modernizr = function(n, e, t) {
             insideFar: 5e3,
             insideLookSpeed: .12,
             insideLookLimitUp: 40,
-            insideLookLimitDown: -90,//-40,
+            insideLookLimitDown: -40,
             orthoNear: 1,
             orthoFar: 5e3,
             orthoBase: 10,
@@ -18210,7 +18210,7 @@ window.Modernizr = function(n, e, t) {
                 var docFragment = document.createDocumentFragment();
                 
                 this.hotGroup.children.forEach(hot=>{
-                    if(hot.texType == 'shine'){
+                    if(hot.info.actionType.openHot){/* hot.texType == 'shine' */
                         var li = document.createElement('li');
                         var span = document.createElement('span');
                         span.innerHTML = hot.info.title || '热点';
@@ -18518,13 +18518,15 @@ window.Modernizr = function(n, e, t) {
                 this.skybox.matrixWorldNeedsUpdate = !0,
                 this.add(this.skybox);
 				
-				setTimeout(function(){
-					this.hotsCount && this.shineHots();
-				}.bind(this),1300);//xzw 热点开始闪烁
-				
-                for (var t in this.tags)
-                    this.tags[t].build();
+				setTimeout(function() {
+                    //this.hotsCount && this.shineHots() 
+                    Hot.beginShineHot()
+                    
+                }
+                .bind(this), 1300) 
                 
+                
+               
                 //add----- 
                 { 
                     let maxCount = browser.isMobile() ? 200000 : 400000    
@@ -20923,7 +20925,7 @@ window.Modernizr = function(n, e, t) {
                         i;
                     var o = this.getHeroDescriptorByHeroIndex(n);
                     if (null === o)
-                        return i;
+                        return i; 
                     if (!o.isPano())
                         return i;
                     var s = this.getHeroPano(o)
@@ -20951,11 +20953,13 @@ window.Modernizr = function(n, e, t) {
             ,
             n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
                 var i = (time==void 0)? c.warp.tourStepDelay : time;
-                i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
+                i==void 0 || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
                 var n = new r.Euler
                   , o = new r.Vector3;
                 y.debug("Starting wait: " + (void 0 !== t));
-                var s = this.calcBurnsAmount(e)
+                
+                var currentLocation = this.model.heroLocations[this.director.currentItem[0]] 
+                var s = currentLocation.dontRot || this.calcBurnsAmount(e)
                   , h = function() {
                     this.endWarpState(),
                     this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
@@ -20967,11 +20971,11 @@ window.Modernizr = function(n, e, t) {
                         return h(),
                         !0;
                     var r = t || 1e3 / 60;
-                    if (c.warp.doBurns)
+                    if (c.warp.doBurns && !currentLocation.dontRot )
                         if (this.player.mode === a.PANORAMA) {
                             var l = this.playerControls.cameras[a.PANORAMA];
                             n.setFromQuaternion(l.quaternion, c.warp.eOrder);
-                            var u = r * s / i;
+                            var u = i == 0 ? s : r * s / i;
                             u = Math.sign(u) * Math.max(u, 0.0001) //add  如果音频长的话,使旋转可见,否则以为停住了
                             n.y += u,
                             o.set(0, 0, -1),
@@ -22815,11 +22819,11 @@ window.Modernizr = function(n, e, t) {
                     }
 
                     if(e.cameraChanged){
-                         
+                        this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon);
                         
                        
                     }
-                    if(e.cameraChanged2){ 
+                    if(e.cameraChanged2){ //变化要更大些
                         for(var i in this.model.hots){
                             this.model.hots[i].update(this)
                         }   
@@ -23112,16 +23116,16 @@ window.Modernizr = function(n, e, t) {
                
                 if(this.model.hotGroup){
                     
-                    var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.openHot )
+                    var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.openHot || e.info.actionType.playAndPause)
                    
                      
                     this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
                     if(this.intersect){
                         deal()
                         this.intersectHot && $("#player").css("cursor", "pointer");
-                        return; 
+                         
                     }
-                }  
+                }   
             
                 
                 
@@ -23132,37 +23136,11 @@ window.Modernizr = function(n, e, t) {
             }
             ,
 			n.prototype.checkHotClick = function() { 
-				if(this.intersectHot){
-                    this.intersectHot.examine(this) 
-					
-					
-					
-					/* g_touraudio.pause();
-					g_bgaudio = false;
-					document.getElementById("bgaudio").pause();
-					  
-					var sWidth = document.body.scrollWidth;
-					var sHeight = document.body.scrollHeight;
-					var pop1 = document.getElementById('popup');
-					pop1.style.display = "block";
-					var myElement = document.createElement("iframe");
-					myElement.src = g_HotMeshes[i].hotLink;
-					myElement.id = "id1";
-					myElement.allowTransparency = "true";
-					myElement.style.width = "100%";
-					myElement.style.height = "100%";
-					myElement.scrolling = "no";
-					var element=document.getElementById("id1");
-					 if (typeof(element)== "undefined" || element == null){
-						 document.getElementById("popup").appendChild(myElement);
-					   }									
-					var oClose = document.getElementById("closepop");
-					oClose.onclick = function() {
-						pop1.style.display = "none";
-						document.getElementById("popup").removeChild(document.getElementById("id1"));
-						$("#popup iframe:last").remove();
-							document.getElementById("bgaudio").play();         
-					} 		 */	
+				if(this.intersectHot){ 
+                    if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
+                        this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser) 
+                    }
+                    this.intersectHot.examine(this)
 					return	true;				
 				}
 			},
@@ -24325,18 +24303,23 @@ window.Modernizr = function(n, e, t) {
                 this.path.discardSlow();
 				//xzw:  
                 var currentLocation = this.model.heroLocations[this.director.currentItem[0]] 
-                var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
-                var current = g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
-                var rotTime = currentLocation && currentLocation.musicInfo.music ? currentLocation.musicInfo.time - current : 2e3;  
-                
-                if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
-                    var timeEachItem = 2000;//假设每个item飞的时间
-                    var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
-                     
-                } 
-                rotTime = Math.max(0, rotTime)
-                console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current) 
-                  
+                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;  
+                    
+                    if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
+                        var timeEachItem = 2000;//假设每个item飞的时间
+                        var rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
+                         
+                    } 
+                    rotTime = Math.max(0, rotTime)
+                    console.log("rotTime "+rotTime +" at item "+this.director.currentItem + ",musicCurrentTime:"+current) 
+                }else{
+                    rotTime = currentLocation.rotTime * 1000
+                    console.log("rotTime "+rotTime +" at item "+this.director.currentItem) 
+                }
 
                 this.path.waitNextStep(e, function() {
                     t && t()

+ 2 - 1
js/manage.js

@@ -511,6 +511,7 @@ var GifTexDeal = {
     remove : function(object){
         var index = this.animateObjects.indexOf(object) 
         if(index>-1){
+            this.animateObjects.splice(index, 1)
             
             if(!this.animateObjects.find(e=>e.animation == object.animation)){
                 let i = this.animateTexs.indexOf(object.animation)
@@ -519,7 +520,7 @@ var GifTexDeal = {
             }
             
             this.stop(object) 
-            this.animateObjects.splice(index, 1)
+            
         }
     },
     setRepeart : function(animation){