Enhance MachineMechanics and InputWithDropDown components; add connections to path interfaces

This commit is contained in:
2025-03-27 12:24:15 +05:30
parent 6b92b6c235
commit 2dfd34f27b
8 changed files with 32 additions and 25 deletions

View File

@@ -3,7 +3,6 @@ import * as THREE from 'three';
import * as Types from '../../../types/world/worldTypes';
import { useEffect } from 'react';
interface Path {
modeluuid: string;
modelName: string;
@@ -13,7 +12,7 @@ interface Path {
rotation: [number, number, number];
actions: { uuid: string; name: string; type: string; material: string; delay: number | string; spawnInterval: number | string; isUsed: boolean }[] | [];
triggers: { uuid: string; name: string; type: string; isUsed: boolean }[] | [];
connections: { source: { pathUUID: string; pointUUID: string }; targets: { pathUUID: string; pointUUID: string }[] } | [];
}[];
pathPosition: [number, number, number];
pathRotation: [number, number, number];
@@ -33,8 +32,8 @@ function Behaviour({ setSimulationPaths }: { setSimulationPaths: any }) {
const point2Position = new THREE.Vector3(0, 1.25, -3.3);
const point1UUID = THREE.MathUtils.generateUUID();
const point2UUID = THREE.MathUtils.generateUUID();
const middlePointUUID = THREE.MathUtils.generateUUID();
const point2UUID = THREE.MathUtils.generateUUID();
const newPath: Path = {
modeluuid: item.modeluuid,
@@ -46,6 +45,7 @@ function Behaviour({ setSimulationPaths }: { setSimulationPaths: any }) {
rotation: [0, 0, 0],
actions: [{ uuid: THREE.MathUtils.generateUUID(), name: 'Action 1', type: 'Inherit', material: 'Inherit', delay: 'Inherit', spawnInterval: 'Inherit', isUsed: false }],
triggers: [],
connections: [],
},
{
uuid: middlePointUUID,
@@ -53,6 +53,7 @@ function Behaviour({ setSimulationPaths }: { setSimulationPaths: any }) {
rotation: [0, 0, 0],
actions: [{ uuid: THREE.MathUtils.generateUUID(), name: 'Action 1', type: 'Inherit', material: 'Inherit', delay: 'Inherit', spawnInterval: 'Inherit', isUsed: false }],
triggers: [],
connections: [],
},
{
uuid: point2UUID,
@@ -60,6 +61,7 @@ function Behaviour({ setSimulationPaths }: { setSimulationPaths: any }) {
rotation: [0, 0, 0],
actions: [{ uuid: THREE.MathUtils.generateUUID(), name: 'Action 1', type: 'Inherit', material: 'Inherit', delay: 'Inherit', spawnInterval: 'Inherit', isUsed: false }],
triggers: [],
connections: [],
},
],
pathPosition: [...item.position],
@@ -77,4 +79,4 @@ function Behaviour({ setSimulationPaths }: { setSimulationPaths: any }) {
return null;
}
export default Behaviour;
export default Behaviour;