feat: Update VehicleAnimator and VehicleInstances components to enhance path handling and integrate vehicle data

This commit is contained in:
Jerald-Golden-B 2025-04-23 13:03:27 +05:30
parent f8a6021b4e
commit faed625c2a
2 changed files with 7 additions and 1 deletions

View File

@ -21,6 +21,7 @@ function VehicleAnimator({ path, handleCallBack, currentPhase, agvUuid }: Vehicl
} }
}, [currentPhase, path]) }, [currentPhase, path])
useFrame((_, delta) => { useFrame((_, delta) => {
if (!path || path.length < 2) return; if (!path || path.length < 2) return;

View File

@ -1,11 +1,16 @@
import React from 'react' import React from 'react'
import VehicleInstance from './instance/vehicleInstance' import VehicleInstance from './instance/vehicleInstance'
import { useVehicleStore } from '../../../../store/simulation/useVehicleStore';
function VehicleInstances() { function VehicleInstances() {
const { vehicles } = useVehicleStore();
return ( return (
<> <>
<VehicleInstance /> {vehicles.map((val: any, i: any) =>
<VehicleInstance agvDetails={val} key={i} />
)}
</> </>
) )