"updated smooth animation"

This commit is contained in:
SreeNath14 2025-04-03 18:24:06 +05:30
parent 1406efd808
commit 5fb911f1a1
4 changed files with 829 additions and 38 deletions

View File

@ -14,12 +14,14 @@ import {
} from "../../../store/store"; } from "../../../store/store";
import { useFrame, useThree } from "@react-three/fiber"; import { useFrame, useThree } from "@react-three/fiber";
import { useSubModuleStore } from "../../../store/useModuleStore"; import { useSubModuleStore } from "../../../store/useModuleStore";
import { usePlayButtonStore } from "../../../store/usePlayButtonStore";
function PathCreation({ function PathCreation({
pathsGroupRef, pathsGroupRef,
}: { }: {
pathsGroupRef: React.MutableRefObject<THREE.Group>; pathsGroupRef: React.MutableRefObject<THREE.Group>;
}) { }) {
const { isPlaying } = usePlayButtonStore();
const { renderDistance } = useRenderDistance(); const { renderDistance } = useRenderDistance();
const { setSubModule } = useSubModuleStore(); const { setSubModule } = useSubModuleStore();
const { setSelectedActionSphere, selectedActionSphere } = const { setSelectedActionSphere, selectedActionSphere } =
@ -66,7 +68,7 @@ function PathCreation({
const distance = new THREE.Vector3( const distance = new THREE.Vector3(
...group.position.toArray() ...group.position.toArray()
).distanceTo(camera.position); ).distanceTo(camera.position);
group.visible = distance <= renderDistance; group.visible = ((distance <= renderDistance) && !isPlaying);
} }
}); });
}); });
@ -193,7 +195,7 @@ function PathCreation({
}; };
return ( return (
<group name="simulation-simulationPaths-group" ref={pathsGroupRef}> <group visible={!isPlaying} name="simulation-simulationPaths-group" ref={pathsGroupRef}>
{simulationPaths.map((path) => { {simulationPaths.map((path) => {
if (path.type === "Conveyor") { if (path.type === "Conveyor") {
const points = path.points.map( const points = path.points.map(

View File

@ -0,0 +1,7 @@
import React from "react";
const Mesh: React.FC = () => {
return <mesh></mesh>;
};
export default Mesh;

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@ function Simulation() {
const [processes, setProcesses] = useState([]); const [processes, setProcesses] = useState([]);
useEffect(() => { useEffect(() => {
// console.log('simulationPaths: ', simulationPaths); console.log('simulationPaths: ', simulationPaths);
}, [simulationPaths]); }, [simulationPaths]);
// useEffect(() => { // useEffect(() => {