feat: Implement deletable event sphere management and refactor point instances for better event handling

This commit is contained in:
2025-07-08 15:16:40 +05:30
parent bffb1e6037
commit a28333f1d9
6 changed files with 243 additions and 214 deletions

View File

@@ -24,6 +24,28 @@ export const useSelectedEventSphere = create<SelectedEventSphereState>()(
}))
);
interface DeletableEventSphereState {
deletableEventSphere: THREE.Mesh | null;
setDeletableEventSphere: (mesh: THREE.Mesh | null) => void;
clearDeletableEventSphere: () => void;
}
export const useDeletableEventSphere = create<DeletableEventSphereState>()(
immer((set) => ({
deletableEventSphere: null,
setDeletableEventSphere: (mesh) => {
set((state) => {
state.deletableEventSphere = mesh;
});
},
clearDeletableEventSphere: () => {
set((state) => {
state.deletableEventSphere = null;
});
},
}))
);
interface SelectedEventDataState {
selectedEventData: { data: EventsSchema; selectedPoint: string } | undefined;
setSelectedEventData: (data: EventsSchema, selectedPoint: string) => void;