|
@@ -307,8 +307,9 @@ export const enter = (dom) => {
|
|
|
//[path1, paht2], { time, speed }
|
|
|
calcPathInfo(paths, info){ //传入的time, speed仅有一个。返回完整的 time, speed
|
|
|
//这一版的control似乎无法在某个位置上改变角度,位置和角度一般都是一起变的,所以先不增加单位更换功能。
|
|
|
-
|
|
|
- let dis = paths[0].position.distanceTo(paths[1].position)
|
|
|
+ let pos1 = new THREE.Vector3().copy(paths[0].position)
|
|
|
+ let pos2 = new THREE.Vector3().copy(paths[1].position)
|
|
|
+ let dis = pos1.distanceTo(pos2)
|
|
|
if(info.time != void 0){
|
|
|
info.speed = dis / info.time
|
|
|
}else{
|