|
|
|
@ -60,9 +60,9 @@ export default class PtrObject extends THREE.Object3D { |
|
|
|
|
|
|
|
override AGVModel = '' |
|
|
|
override AGVFnModel = '' |
|
|
|
override rotationSpeed: number = 0 |
|
|
|
override showForkSpeed: number = 0 |
|
|
|
override upForkSpeed: number = 0 |
|
|
|
override __rotationSpeed: number = 0 |
|
|
|
override __showForkSpeed: number = 0 |
|
|
|
override __upForkSpeed: number = 0 |
|
|
|
|
|
|
|
private boxBody: any = null |
|
|
|
private __toPos: THREE.Vector3 = null |
|
|
|
@ -662,10 +662,10 @@ export default class PtrObject extends THREE.Object3D { |
|
|
|
} else if (data.OperationType == 3 && data.ChargeDirection >= 0 && data.ChargeDirection <= 3) { |
|
|
|
endDirection = data.ChargeDirection |
|
|
|
} else if (data.OperationType == 4 && data.GoodsSlotDirection >= 0 && data.GoodsSlotDirection <= 3) { |
|
|
|
if (data.GoodsSlotDirection == 3) { |
|
|
|
endDirection = 0 |
|
|
|
if (data.GoodsSlotDirection == 0) { |
|
|
|
endDirection = 3 |
|
|
|
} else { |
|
|
|
endDirection = (data.GoodsSlotDirection + 1) as LogicDirection |
|
|
|
endDirection = (data.GoodsSlotDirection - 1) as LogicDirection |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -794,7 +794,7 @@ export default class PtrObject extends THREE.Object3D { |
|
|
|
this.OperationType = 0 |
|
|
|
this.TaskMode = 0 |
|
|
|
this.executeTask() |
|
|
|
}, 2000) |
|
|
|
}, 2000 / (worldModel.state.runState.timeRate ?? 1)) |
|
|
|
} |
|
|
|
|
|
|
|
/*==========动作处理============*/ |
|
|
|
@ -855,7 +855,9 @@ export default class PtrObject extends THREE.Object3D { |
|
|
|
const pos = Model.getPositionByLogicXY(logicX, logicY) |
|
|
|
this.__toPos = pos as THREE.Vector3 |
|
|
|
//加速度
|
|
|
|
const a = 0.4 |
|
|
|
const a = 0.4 * (worldModel.state.runState.timeRate ?? 1) |
|
|
|
const sa = 0.4 * (worldModel.state.runState.timeRate ?? 1) |
|
|
|
speed = speed * (worldModel.state.runState.timeRate ?? 1) |
|
|
|
|
|
|
|
if (this.position.x < this.__toPos.x || this.position.z < this.__toPos.z) { |
|
|
|
speed = Math.abs(speed) |
|
|
|
@ -918,7 +920,7 @@ export default class PtrObject extends THREE.Object3D { |
|
|
|
if (cSpeed == 0) { |
|
|
|
this.boxBody.activate() |
|
|
|
} |
|
|
|
if (distance <= stopDistance + 0.2) { |
|
|
|
if (distance <= stopDistance) { |
|
|
|
if (currentPhase != 'decelerate') { |
|
|
|
currentPhase = 'decelerate' |
|
|
|
const sp = new this.viewport.ammoModel.btVector3(velocity.x(), velocity.y(), velocity.z()) |
|
|
|
@ -949,7 +951,7 @@ export default class PtrObject extends THREE.Object3D { |
|
|
|
case 'decelerate': |
|
|
|
// 检测停止
|
|
|
|
if (cSpeed > 0) { |
|
|
|
this.boxBody.setDamping(0.6, 0); |
|
|
|
this.boxBody.setDamping(sa, 0); |
|
|
|
} |
|
|
|
this.boxBody.activate() |
|
|
|
break |
|
|
|
|