Files
Dwinzo_dev/app/src/modules/simulation/simulation.tsx

47 lines
1.6 KiB
TypeScript
Raw Normal View History

import { useState, useEffect, useRef, useMemo } from 'react';
import { useSelectedActionSphere, useSelectedPath, useSimulationPaths } from '../../store/store';
2025-03-25 17:34:20 +05:30
import * as THREE from 'three';
import Behaviour from './behaviour/behaviour';
import PathCreation from './path/pathCreation';
import PathConnector from './path/pathConnector';
import useModuleStore from '../../store/useModuleStore';
2025-04-01 18:54:04 +05:30
import ProcessContainer from './process/processContainer';
2025-03-25 17:34:20 +05:30
function Simulation() {
const { activeModule } = useModuleStore();
const pathsGroupRef = useRef() as React.MutableRefObject<THREE.Group>;
const { simulationPaths, setSimulationPaths } = useSimulationPaths();
const [processes, setProcesses] = useState([]);
useEffect(() => {
// console.log('simulationPaths: ', simulationPaths);
2025-03-25 17:34:20 +05:30
}, [simulationPaths]);
// useEffect(() => {
// if (selectedActionSphere) {
// console.log('selectedActionSphere: ', selectedActionSphere);
// }
// }, [selectedActionSphere]);
// useEffect(() => {
// if (selectedPath) {
// console.log('selectedPath: ', selectedPath);
// }
// }, [selectedPath]);
2025-03-25 17:34:20 +05:30
return (
<>
<Behaviour />
2025-03-25 17:34:20 +05:30
{activeModule === 'simulation' && (
<>
<PathCreation pathsGroupRef={pathsGroupRef} />
<PathConnector pathsGroupRef={pathsGroupRef} />
2025-04-01 18:54:04 +05:30
<ProcessContainer />
2025-03-25 17:34:20 +05:30
</>
)}
</>
);
}
export default Simulation;