Merged With AGV-UI
This commit is contained in:
@@ -3,7 +3,7 @@ import VehicleAnimator from '../animator/vehicleAnimator';
|
||||
import * as THREE from 'three';
|
||||
import { NavMeshQuery } from '@recast-navigation/core';
|
||||
import { useNavMesh } from '../../../../../store/store';
|
||||
import { usePlayButtonStore, useResetButtonStore } from '../../../../../store/usePlayButtonStore';
|
||||
import { usePlayButtonStore } from '../../../../../store/usePlayButtonStore';
|
||||
import { useVehicleStore } from '../../../../../store/simulation/useVehicleStore';
|
||||
|
||||
function VehicleInstance({ agvDetail }: any) {
|
||||
@@ -12,7 +12,7 @@ function VehicleInstance({ agvDetail }: any) {
|
||||
const { vehicles, setVehicleActive, setVehicleState, incrementVehicleLoad } = useVehicleStore();
|
||||
const [currentPhase, setCurrentPhase] = useState<string>('stationed');
|
||||
const [path, setPath] = useState<[number, number, number][]>([]);
|
||||
let isIncrememtable = useRef(true);
|
||||
let isIncrememtable = useRef<boolean>(true);
|
||||
|
||||
const computePath = useCallback(
|
||||
(start: any, end: any) => {
|
||||
@@ -20,7 +20,7 @@ function VehicleInstance({ agvDetail }: any) {
|
||||
const navMeshQuery = new NavMeshQuery(navMesh);
|
||||
const { path: segmentPath } = navMeshQuery.computePath(start, end);
|
||||
return (
|
||||
segmentPath?.map(({ x, y, z }) => [x, y + 0.1, z] as [number, number, number]) || []
|
||||
segmentPath?.map(({ x, y, z }) => [x, 0, z] as [number, number, number]) || []
|
||||
);
|
||||
} catch {
|
||||
return [];
|
||||
@@ -41,7 +41,6 @@ function VehicleInstance({ agvDetail }: any) {
|
||||
setPath([]);
|
||||
}
|
||||
|
||||
|
||||
const increment = () => {
|
||||
if (isIncrememtable.current) {
|
||||
console.log('called');
|
||||
|
||||
Reference in New Issue
Block a user