|
@@ -82467,6 +82467,10 @@
|
|
|
posePathModels.includes(model) || posePathModels.push(model);
|
|
|
});
|
|
|
});
|
|
|
+ /*
|
|
|
+ 路径>关键帧。但是如果每条路径开头和结尾以及过渡时没有关键帧,保持路径开头和结尾的姿态
|
|
|
+
|
|
|
+ */
|
|
|
posePathModels.forEach(model => {
|
|
|
var pathKeys = this.pathKeys.get(model) || [];
|
|
|
var poseKeys = this.poseKeys.get(model) || [];
|
|
@@ -82489,13 +82493,10 @@
|
|
|
if (poseKeys.length) {
|
|
|
tweens.scale = new Tween$1(poseKeys.map(e => e.time), poseKeys.map(e => e.scale));
|
|
|
model.scale.copy(tweens.scale.lerp(time));
|
|
|
- tweens.qua = new Tween$1(poseKeys.map(e => e.time), poseKeys.map(e => e.qua));
|
|
|
- model.quaternion.copy(tweens.qua.lerp(time));
|
|
|
} else {
|
|
|
- if (pathKeys.length) {
|
|
|
- var _model$defaultAniPose;
|
|
|
- model.quaternion.copy(((_model$defaultAniPose = model.defaultAniPose) === null || _model$defaultAniPose === void 0 ? void 0 : _model$defaultAniPose.quaternion) || new Quaternion()); //设置路径朝向前要先还原
|
|
|
- }
|
|
|
+ /* if(pathKeys.length){
|
|
|
+ model.quaternion.copy(model.defaultAniPose?.quaternion || new THREE.Quaternion()) //设置路径朝向前要先还原
|
|
|
+ } */
|
|
|
}
|
|
|
if (atPath) {
|
|
|
//沿着curve行走,目视curve前方 (参照CameraAnimationCurve,搜quaFromCurveTan)
|
|
@@ -82533,11 +82534,13 @@
|
|
|
if (poseKeys.length) {
|
|
|
tweens.pos = new Tween$1(poseKeys.map(e => e.time), poseKeys.map(e => e.pos));
|
|
|
model.position.copy(tweens.pos.lerp(time));
|
|
|
- var poseKeys2 = poseKeys.filter(e => e.isPath);
|
|
|
- if (poseKeys2.length) {
|
|
|
- tweens.qua = new Tween$1(poseKeys2.map(e => e.time), poseKeys2.map(e => e.qua));
|
|
|
- model.quaternion.copy(tweens.qua.lerp(time));
|
|
|
- }
|
|
|
+ tweens.qua = new Tween$1(poseKeys.map(e => e.time), poseKeys.map(e => e.qua));
|
|
|
+ model.quaternion.copy(tweens.qua.lerp(time));
|
|
|
+ /* let poseKeys2 = poseKeys.filter(e=>e.isPath)//妈呀为什么这么写我忘了
|
|
|
+ if(poseKeys2.length ){
|
|
|
+ tweens.qua = new Tween(poseKeys2.map(e=>e.time), poseKeys2.map(e=>e.qua))
|
|
|
+ model.quaternion.copy(tweens.qua.lerp(time))
|
|
|
+ } */
|
|
|
}
|
|
|
}
|
|
|
if (poseKeys.length || pathKeys.length) {
|
|
@@ -82610,8 +82613,8 @@
|
|
|
animateActions.forEach(action => {
|
|
|
action.setEffectiveTimeScale(action.tempSW_.scale); //speed 只有没paused时有效
|
|
|
action.setEffectiveWeight(action.tempSW_.weight);
|
|
|
- action.time = action.tempSW_.time % ((action.clipDur_ || action._clip.duration) / action.tempSW_.scale) * action.tempSW_.scale; //只有paused时有效
|
|
|
- action.tempSW_.weight < 1 && console.log('action', action._clip.name, action.time, action.weight);
|
|
|
+ action.time = action.tempSW_.time % (action._clip.duration / action.tempSW_.scale) * action.tempSW_.scale; //只有paused时有效
|
|
|
+ //action.tempSW_.weight < 1 && console.log('action', action._clip.name, action.time, action.weight )
|
|
|
});
|
|
|
|
|
|
//model.mixer.timeScale = 1 ;
|