"updated smooth animation"
This commit is contained in:
parent
1406efd808
commit
5fb911f1a1
app/src/modules/simulation
|
@ -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(
|
||||||
|
|
|
@ -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
|
@ -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(() => {
|
||||||
|
|
Loading…
Reference in New Issue