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