xzw 5 달 전
부모
커밋
84b29eb740
3개의 변경된 파일33개의 추가작업 그리고 18개의 파일을 삭제
  1. 22 14
      public/lib/potree/potree.js
  2. 1 1
      public/lib/potree/potree.js.map
  3. 10 3
      src/sdk/cover/index.js

+ 22 - 14
public/lib/potree/potree.js

@@ -25509,7 +25509,9 @@
 	  showNeighSetGui: browser.urlHasValue('neighGui'),
 	  selectShowBox: true,
 	  //fastTran: isTest
-	  pathSmooth: true // window.location.href.includes('192.168.0.59')  //true //smooth曲线, 非折线
+	  pathSmooth: true,
+	  // window.location.href.includes('192.168.0.59')  //true //smooth曲线, 非折线
+	  maxClipFadeTime: 0.6
 	};
 	Potree.config = config$1;
 	Potree.settings = settings;
@@ -81672,7 +81674,7 @@
 	//有的动画,如小狗,进来如果不play停在第一帧,mesh会错,爪子在前面;但如果都停在第一帧,动作有可能很奇怪
 
 	var tweens = {};
-	var maxClipFadeTime = 1; //渐变时间 s
+	var maxClipFadeTime = Potree.settings.maxClipFadeTime; //渐变时间 s
 	var pathStates = new Map();
 	//actions中可能包含没有动作的 如TPose
 
@@ -81687,6 +81689,7 @@
 
 	    this.duration = 0; //动画时长
 	    this.time = 0; //当前播放时间
+	    this.cursorTime = 0; //时间轴指针时间
 	  }
 	  addKey(model, keyType, key) {
 	    var keys = this[keyType + 'Keys'].get(model);
@@ -81714,12 +81717,21 @@
 	  }
 	  at(time, delta) {
 	    var _this = this;
+	    this.dispatchEvent({
+	      type: 'atTime',
+	      time
+	    }); //该时间可以大于本动画持续时间
+	    this.cursorTime = time;
 	    if (time > this.duration + maxClipFadeTime / 2) {
 	      for (var [model, keys] of this.clipKeys) {
 	        model.actions.forEach(a => a.stop());
 	      }
-	      return;
 	    }
+	    var maxTime = this.duration + maxClipFadeTime / 2;
+	    if (time >= maxTime) time = maxTime;
+	    if (this.time == time) return;
+	    this.time = time; //真实值
+
 	    var transitionRatio = 0.05 * delta * 60; //渐变系数,越小缓动程度越高,越平滑 //假设标准帧率为60fps,当帧率低时(delta大时) 降低缓动。速度快时缓动太高会偏移路径
 	    var _loop = function _loop() {
 	      //路径。开头结尾和别的衔接过渡
@@ -81875,11 +81887,6 @@
 	      }
 	    }
 	    viewer.dispatchEvent('content_changed');
-	    this.currentTime = time;
-	    this.dispatchEvent({
-	      type: 'atTime',
-	      time
-	    });
 	  }
 	  getPoseAtPathKey(key, percent) {
 	    var percent2 = percent + 0.001;
@@ -81901,18 +81908,18 @@
 	      camFollowObject,
 	      time = -maxClipFadeTime / 2
 	    } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
-	    Potree.settings.displayMode = 'showPointCloud';
-	    this.time = time; //动画时长比duration多一个maxClipFadeTime,为了给开始和结束动画过渡
+	    //动画时长比duration多一个maxClipFadeTime,为了给开始和结束动画过渡
+
 	    this.updateTimeRange();
 	    this.setCameraFollow(camFollowObject);
 	    this.playing && this.pause();
 	    var maxTime = this.duration + maxClipFadeTime / 2;
 	    this.playing = true;
 	    this.onUpdate = e => {
-	      this.time += e.delta;
-	      if (this.time >= maxTime) this.time = maxTime;
-	      this.at(this.time, e.delta);
-	      if (this.time >= maxTime) {
+	      time += e.delta;
+	      if (!Potree.settings.isOfficial && time >= maxTime) time = maxTime;
+	      this.at(time, e.delta);
+	      if (!Potree.settings.isOfficial && time >= maxTime) {
 	        this.dispatchEvent('stop');
 	        this.pause();
 	      }
@@ -81931,6 +81938,7 @@
 	    //for test
 	    this.camFollowObject = camFollowObject;
 	    if (!camFollowObject) return;
+	    Potree.settings.displayMode = 'showPointCloud';
 	    if (!(this.camFollowObject instanceof Array)) {
 	      //支持相机跟随多个物体,对着bound的中心
 	      this.camFollowObject = [this.camFollowObject];

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
public/lib/potree/potree.js.map


+ 10 - 3
src/sdk/cover/index.js

@@ -1353,6 +1353,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
             
             AnimationEditor.addEventListener('atTime',e=>{//发送当前动画时间,同步字幕
                 let time = /* THREE.Math.clamp( */e.time/* , 0, AnimationEditor.duration) */
+                //console.log('currentTime',time)
                 bus.emit('currentTime',time)
             })
             /* AnimationEditor.addEventListener('stop',e=>{
@@ -1363,7 +1364,7 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                 bus,
                 play(){
                     //console.log('play')
-                    AnimationEditor.play({time:AnimationEditor.currentTime})
+                    AnimationEditor.play({time:AnimationEditor.cursorTime})
                 },
                 pause(){
                     //console.log('pause')
@@ -1582,8 +1583,14 @@ export const enter = ({ dom, mapDom, isLocal, lonlat, scenes, laserRoot, laserOS
                                 x = right.pos.x + margin  
                             }
                             return {x,y}
-                        }, 
-                    })
+                        },
+
+                        delayEndTime(){
+                            return  Potree.settings.maxClipFadeTime / 2
+                        }                        
+                    }) 
+                    
+                    
                     
                     return result