|
@@ -82666,30 +82666,27 @@
|
|
|
pathQua.multiplyQuaternions(pathQua, rot90Qua); //这是当模型导进来就旋转正确时的quaternion
|
|
|
key.curQua_ = pathQua.clone(); //记录下
|
|
|
if (model.quaAtPath) {
|
|
|
- //quaternion = pathQua.premultiply(model.quaAtPath)
|
|
|
quaternion = new Quaternion().multiplyQuaternions(pathQua, model.quaAtPath);
|
|
|
} else {
|
|
|
quaternion = pathQua.clone();
|
|
|
}
|
|
|
- //quaternion.multiplyQuaternions( quaternion, rot90Qua );
|
|
|
|
|
|
//model && quaternion.multiplyQuaternions( quaternion, model.quaternion ); //应用当前已有的quaternion
|
|
|
//如果要将模型底部中心对准路径,需要先修改好模型scale ,然后boundingBox中心应用scale和qua, 加到position里
|
|
|
//目前两个人物模型刚好模型pivot在脚底,如果是其他物体甚至直接用curve的朝向不太对,没有明确朝向。除非所有模型都保持上路径前的朝向
|
|
|
//或者pos的z还用之前的
|
|
|
+ //产品说位置偏移不管它,因为路径可以隐藏和修改。只要记录相对旋转即可。
|
|
|
return {
|
|
|
position,
|
|
|
quaternion
|
|
|
};
|
|
|
}
|
|
|
getModelQuaAtPath(model) {
|
|
|
- //获取当前时间
|
|
|
+ //当前时间在路径上时,旋转模型后立即执行该函数,获取相对旋转值
|
|
|
if (!model.atPath) return;
|
|
|
- //let qua = new THREE.Quaternion().multiplyQuaternions(model.quaternion, model.atPath.curQua_.clone().invert())
|
|
|
var qua = new Quaternion().multiplyQuaternions(model.atPath.curQua_.clone().invert(), model.quaternion);
|
|
|
- //qua = new THREE.Quaternion().multiplyQuaternions(qua, rot90Qua.clone().invert())
|
|
|
|
|
|
- console.log('getModelQuaAtPath', qua);
|
|
|
+ //console.log('getModelQuaAtPath',qua)
|
|
|
model.quaAtPath = qua; //相对旋转
|
|
|
return qua;
|
|
|
}
|