|
|
|
@ -275,12 +275,14 @@ const AGVAnimationF = (item, type, newLocation = 0, time = 2000) => {
|
|
|
|
|
resolve()
|
|
|
|
|
}
|
|
|
|
|
let distance = location - agvData[AGVLocationData].x
|
|
|
|
|
const tween = new TWEEN.Tween(agvData[group].position)
|
|
|
|
|
let tween = new TWEEN.Tween(agvData[group].position)
|
|
|
|
|
.to({ x: location }, Math.abs(distance) / s * 16) // 移动到(1, 1, 1),持续1000毫秒
|
|
|
|
|
.onComplete(() => {
|
|
|
|
|
agvData[group].position.x = location
|
|
|
|
|
agvData[AGVLocationData].x = location
|
|
|
|
|
resolve()
|
|
|
|
|
tween.stop()
|
|
|
|
|
tween = null
|
|
|
|
|
})
|
|
|
|
|
.start() // 立即开始动画
|
|
|
|
|
// let time1 = setInterval(() => {
|
|
|
|
@ -332,12 +334,14 @@ const AGVAnimationF = (item, type, newLocation = 0, time = 2000) => {
|
|
|
|
|
}
|
|
|
|
|
let distance = location - agvData[AGVLocationData].z
|
|
|
|
|
|
|
|
|
|
const tween = new TWEEN.Tween(agvData[group].position)
|
|
|
|
|
let tween = new TWEEN.Tween(agvData[group].position)
|
|
|
|
|
.to({ z: location }, Math.abs(distance) / s * 16) // 移动到(1, 1, 1),持续1000毫秒
|
|
|
|
|
.onComplete(() => {
|
|
|
|
|
agvData[group].position.z = location
|
|
|
|
|
agvData[AGVLocationData].z = location
|
|
|
|
|
resolve()
|
|
|
|
|
tween.stop()
|
|
|
|
|
tween = null
|
|
|
|
|
})
|
|
|
|
|
.start()
|
|
|
|
|
// let time1 = setInterval(() => {
|
|
|
|
@ -388,11 +392,13 @@ const AGVAnimationF = (item, type, newLocation = 0, time = 2000) => {
|
|
|
|
|
let endRotateNum = nowRotateNum + (distance * (Math.PI / 180))
|
|
|
|
|
let bool = (nowRotateNum - endRotateNum) > 0
|
|
|
|
|
|
|
|
|
|
const tween = new TWEEN.Tween(agvData[group].rotation)
|
|
|
|
|
let tween = new TWEEN.Tween(agvData[group].rotation)
|
|
|
|
|
.to({ y: newLocation * (Math.PI / 180) }, 500) // 移动到(1, 1, 1),持续1000毫秒
|
|
|
|
|
.onComplete(() => {
|
|
|
|
|
agvData[group].rotation.y = (newLocation * (Math.PI / 180))
|
|
|
|
|
resolve()
|
|
|
|
|
tween.stop()
|
|
|
|
|
tween = null
|
|
|
|
|
})
|
|
|
|
|
.start()
|
|
|
|
|
// let time1 = setInterval(() => {
|
|
|
|
|