From 40854a4bd76c64895f2692dc3c8ce26349ea53ab Mon Sep 17 00:00:00 2001 From: Jerald-Golden-B Date: Sat, 20 Dec 2025 12:38:53 +0530 Subject: [PATCH] feat: introduce `VehicleAnimator` component for animating 3D vehicles along defined paths with play/pause/reset functionality. --- .../simulation/vehicle/instances/animator/vehicleAnimator.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/modules/simulation/vehicle/instances/animator/vehicleAnimator.tsx b/app/src/modules/simulation/vehicle/instances/animator/vehicleAnimator.tsx index b94a167..304ccdf 100644 --- a/app/src/modules/simulation/vehicle/instances/animator/vehicleAnimator.tsx +++ b/app/src/modules/simulation/vehicle/instances/animator/vehicleAnimator.tsx @@ -18,7 +18,7 @@ interface VehicleAnimatorProps { function VehicleAnimator({ path, handleCallBack, currentPhase, agvUuid, agvDetail, reset, startUnloadingProcess }: Readonly) { const { vehicleStore } = useSceneContext(); - const { getVehicleById } = vehicleStore(); + const { getVehicleById, incrementDistanceTraveled } = vehicleStore(); const { isPaused } = usePauseButtonStore(); const { isPlaying } = usePlayButtonStore(); const { speed } = useAnimationPlaySpeed(); @@ -126,6 +126,7 @@ function VehicleAnimator({ path, handleCallBack, currentPhase, agvUuid, agvDetai if (isAligned) { progressRef.current += delta * (speed * agvDetail.speed); + incrementDistanceTraveled(agvUuid, delta * (speed * agvDetail.speed)); const t = (progressRef.current - accumulatedDistance) / segmentDistance; const position = start.clone().lerp(end, t); object.position.copy(position);