human assembly rotation and movement bug fixed
This commit is contained in:
@@ -123,8 +123,17 @@ function HumanInstance({ human }: { human: HumanStatus }) {
|
||||
if (!human.point.action.assemblyPoint || human.point.action.actionType === 'worker') return;
|
||||
|
||||
if (!human.isActive && human.state === 'idle' && currentPhase === 'init') {
|
||||
const toPickupPath = computePath(
|
||||
new THREE.Vector3(human?.position[0], human?.position[1], human?.position[2]),
|
||||
new THREE.Vector3(
|
||||
human?.point?.action?.assemblyPoint?.position?.[0] ?? 0,
|
||||
human?.point?.action?.assemblyPoint?.position?.[1] ?? 0,
|
||||
human?.point?.action?.assemblyPoint?.position?.[2] ?? 0
|
||||
)
|
||||
);
|
||||
setPath(toPickupPath);
|
||||
setHumanState(human.modelUuid, 'idle');
|
||||
setCurrentPhase('waiting');
|
||||
setCurrentPhase('init_assembly');
|
||||
setHumanActive(human.modelUuid, false);
|
||||
setCurrentAnimation(human.modelUuid, 'idle', true, true, true);
|
||||
humanStatus(human.modelUuid, 'Human is waiting for material in assembly');
|
||||
@@ -293,6 +302,13 @@ function HumanInstance({ human }: { human: HumanStatus }) {
|
||||
setCurrentAnimation(human.modelUuid, 'idle', true, true, true);
|
||||
humanStatus(human.modelUuid, 'Reached pickup point, waiting for material');
|
||||
setPath([]);
|
||||
} if (currentPhase === 'init_assembly') {
|
||||
setCurrentPhase('waiting');
|
||||
setHumanState(human.modelUuid, 'idle');
|
||||
setHumanActive(human.modelUuid, false);
|
||||
setCurrentAnimation(human.modelUuid, 'idle', true, true, true);
|
||||
humanStatus(human.modelUuid, 'Reached assembly point, waiting for material');
|
||||
setPath([]);
|
||||
} else if (currentPhase === 'pickup-drop') {
|
||||
setCurrentPhase('dropping');
|
||||
setHumanState(human.modelUuid, 'idle');
|
||||
|
||||
Reference in New Issue
Block a user