|
@@ -18,11 +18,11 @@ let createAnimatePath = (token)=>{//实时路径 保存:generateAniPathData
|
|
|
pathModels[i].model = model
|
|
|
model.inUse = true //使用
|
|
|
viewer.objs.add(model)
|
|
|
- let qua = getQuaternion(aniPaths[i])
|
|
|
+ /* let qua = getQuaternion(aniPaths[i])
|
|
|
let pos = aniPaths[i].points[0]
|
|
|
model.position.copy(pos)
|
|
|
model.quaternion.copy(qua)
|
|
|
- model.dispatchEvent('position_changed')
|
|
|
+ model.dispatchEvent('position_changed') */
|
|
|
}
|
|
|
let unuseModel = (pathModel)=>{
|
|
|
if(!pathModel.model)return
|
|
@@ -107,6 +107,7 @@ let createAnimatePath = (token)=>{//实时路径 保存:generateAniPathData
|
|
|
if(needIndex != -1){
|
|
|
useModel(model_, needIndex)
|
|
|
}
|
|
|
+ model_.lastPos = model_.position.clone(), model_.lastQua = model_.quaternion.clone()
|
|
|
model_.visible = true
|
|
|
|
|
|
model_.actions[model_.name == 'Man' ? 1 : 2].play()
|
|
@@ -180,6 +181,7 @@ let createAnimatePath = (token)=>{//实时路径 保存:generateAniPathData
|
|
|
const rot90Qua = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1,0,0),-Math.PI/2)
|
|
|
|
|
|
function getQuaternion(path){
|
|
|
+ if(!path.curve)return
|
|
|
let position2 = path.curve.getPointAt(0.01);
|
|
|
let position = path.points[0]
|
|
|
let pathQua = Potree.math.getQuaFromPosAim(position,position2)
|
|
@@ -214,13 +216,15 @@ let createAnimatePath = (token)=>{//实时路径 保存:generateAniPathData
|
|
|
|
|
|
pathDevices?.forEach((e,i)=>{
|
|
|
let model = pathModels[i].model
|
|
|
- if(!model)return
|
|
|
+ if(!model )return
|
|
|
|
|
|
let aimQua = getQuaternion(aniPaths[i])
|
|
|
let aimPos = aniPaths[i].points[0]
|
|
|
- lerp.quaternion(model.quaternion, aimQua)(transitionRatio) //每次只改变一点点
|
|
|
- lerp.vector(model.position, aimPos)(transitionRatio)
|
|
|
+ aimQua && lerp.quaternion(model.quaternion, aimQua)(transitionRatio) //每次只改变一点点
|
|
|
+ aimPos && lerp.vector(model.position, aimPos)(transitionRatio)
|
|
|
+
|
|
|
model.dispatchEvent('position_changed')
|
|
|
+ model.lastPos = model.position.clone(), model.lastQua = model.quaternion.clone()
|
|
|
})
|
|
|
|
|
|
if(camFollowDevice != void 0 && !viewer.scene.monitors.some(e=>e.isWatching) && viewer.images360.latestRequestMode == 'showPointCloud'){
|