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