Refactor AGV and PathNavigator components; add NavMeshCreator for improved navigation handling and added backend event storage for connections
This commit is contained in:
31
app/src/modules/builder/agv/navMeshCreator.tsx
Normal file
31
app/src/modules/builder/agv/navMeshCreator.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { useRef } from "react";
|
||||
import { useNavMesh } from "../../../store/store";
|
||||
import PolygonGenerator from "./polygonGenerator";
|
||||
import NavMeshDetails from "./navMeshDetails";
|
||||
import * as CONSTANTS from "../../../types/world/worldConstants";
|
||||
import * as Types from "../../../types/world/worldTypes";
|
||||
|
||||
type NavMeshCreatorProps = {
|
||||
lines: Types.RefLines
|
||||
};
|
||||
|
||||
function NavMeshCreator({ lines }: NavMeshCreatorProps) {
|
||||
let groupRef = useRef() as Types.RefGroup;
|
||||
const { setNavMesh } = useNavMesh();
|
||||
|
||||
return (
|
||||
<>
|
||||
<PolygonGenerator groupRef={groupRef} lines={lines} />
|
||||
<NavMeshDetails lines={lines} setNavMesh={setNavMesh} groupRef={groupRef} />
|
||||
|
||||
<group ref={groupRef} visible={false} name="Meshes">
|
||||
<mesh rotation-x={CONSTANTS.planeConfig.rotation} position={CONSTANTS.planeConfig.position3D} name="Plane" receiveShadow>
|
||||
<planeGeometry args={[300, 300]} />
|
||||
<meshBasicMaterial color={CONSTANTS.planeConfig.color} />
|
||||
</mesh>
|
||||
</group>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default NavMeshCreator
|
||||
Reference in New Issue
Block a user