- Added ArmBot component to manage ArmBot instances in the simulation. - Created ArmBotInstances component to render individual ArmBot models. - Developed IKAnimationController for handling inverse kinematics during animations. - Introduced IkInstances component to load and manage IK-enabled arm models. - Defined simulation types for ArmBot events and connections in TypeScript. - Enhanced type definitions for better clarity and maintainability.
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import { useState, useRef } from "react";
|
|
import * as THREE from "three";
|
|
import PathCreation from "./path/pathCreation";
|
|
import PathConnector from "./path/pathConnector";
|
|
import useModuleStore from "../../store/useModuleStore";
|
|
import ProcessContainer from "./process/processContainer";
|
|
import Agv from "../builder/agv/agv";
|
|
import ArmBot from "./armbot/ArmBot";
|
|
|
|
function Simulation() {
|
|
const { activeModule } = useModuleStore();
|
|
const pathsGroupRef = useRef() as React.MutableRefObject<THREE.Group>;
|
|
const [processes, setProcesses] = useState<any[]>([]);
|
|
const agvRef = useRef([]);
|
|
const MaterialRef = useRef([]);
|
|
|
|
return (
|
|
<>
|
|
{activeModule === "simulation" && (
|
|
<>
|
|
<PathCreation pathsGroupRef={pathsGroupRef} />
|
|
|
|
<PathConnector pathsGroupRef={pathsGroupRef} />
|
|
|
|
<ProcessContainer
|
|
processes={processes}
|
|
setProcesses={setProcesses}
|
|
agvRef={agvRef}
|
|
MaterialRef={MaterialRef}
|
|
/>
|
|
|
|
<Agv
|
|
processes={processes}
|
|
agvRef={agvRef}
|
|
MaterialRef={MaterialRef}
|
|
/>
|
|
|
|
</>
|
|
)}
|
|
<ArmBot />
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default Simulation;
|