Refactor vehicle simulation components for improved path handling and state management

- Updated PointsCreator component to enhance event data selection and keyboard handling.
- Refactored VehicleAnimator to streamline animation logic and reset handling.
- Simplified VehicleInstance logic for better clarity and maintainability.
- Modified vehicle data structure to include rotation information for pick-up and unload points.
- Adjusted TypeScript types to reflect new vehicle point schema with nested position and rotation properties.
This commit is contained in:
2025-04-29 10:33:30 +05:30
parent ccc7a1d954
commit ea53af62c4
6 changed files with 538 additions and 563 deletions

View File

@@ -28,8 +28,8 @@ function Vehicles() {
actionType: "travel",
unLoadDuration: 10,
loadCapacity: 2,
pickUpPoint: { x: 98.71483985219794, y: 0, z: 28.66321267938962 },
unLoadPoint: { x: 105.71483985219794, y: 0, z: 28.66321267938962 },
pickUpPoint: { position: { x: 98.71483985219794, y: 0, z: 28.66321267938962 }, rotation: { x: 0, y: 0, z: 0 } },
unLoadPoint: { position: { x: 105.71483985219794, y: 0, z: 28.66321267938962 }, rotation: { x: 0, y: 0, z: 0 } },
triggers: [
{
triggerUuid: "trig-001",
@@ -71,8 +71,8 @@ function Vehicles() {
actionType: "travel",
unLoadDuration: 10,
loadCapacity: 2,
pickUpPoint: { x: 90, y: 0, z: 28 },
unLoadPoint: { x: 20, y: 0, z: 10 },
pickUpPoint: { position: { x: 90, y: 0, z: 28 }, rotation: { x: 0, y: 0, z: 0 } },
unLoadPoint: { position: { x: 20, y: 0, z: 10 }, rotation: { x: 0, y: 0, z: 0 } },
triggers: [
{
triggerUuid: "trig-001",
@@ -95,7 +95,8 @@ function Vehicles() {
]
}
}
}, {
},
{
modelUuid: "e729a4f1-11d2-4778-8d6a-468f1b4f6b79",
modelName: "forklift",
position: [98.85729337188162, 0, 38.36616546567653],
@@ -113,8 +114,8 @@ function Vehicles() {
actionType: "travel",
unLoadDuration: 15,
loadCapacity: 5,
pickUpPoint: { x: 98.71483985219794, y: 0, z: 28.66321267938962 },
unLoadPoint: { x: 20, y: 0, z: 10 },
pickUpPoint: { position: { x: 98.71483985219794, y: 0, z: 28.66321267938962 }, rotation: { x: 0, y: 0, z: 0 } },
unLoadPoint: { position: { x: 20, y: 0, z: 10 }, rotation: { x: 0, y: 0, z: 0 } },
triggers: [
{
triggerUuid: "trig-001",