feat: Enhance human event handling and animation management, including state updates and monitoring

This commit is contained in:
2025-07-03 16:55:30 +05:30
parent 8dd853dd03
commit 1e715cee50
13 changed files with 316 additions and 36 deletions

View File

@@ -15,6 +15,10 @@ interface HumansStore {
setHumanActive: (modelUuid: string, isActive: boolean) => void;
setHumanPicking: (modelUuid: string, isPicking: boolean) => void;
setHumanLoad: (modelUuid: string, load: number) => void;
setHumanState: (
modelUuid: string,
newState: HumanStatus["state"]
) => void;
incrementHumanLoad: (modelUuid: string, incrementBy: number) => void;
decrementHumanLoad: (modelUuid: string, decrementBy: number) => void;
@@ -106,6 +110,15 @@ export const createHumanStore = () => {
});
},
setHumanState: (modelUuid, newState) => {
set((state) => {
const human = state.humans.find(h => h.modelUuid === modelUuid);
if (human) {
human.state = newState;
}
});
},
incrementHumanLoad: (modelUuid, incrementBy) => {
set((state) => {
const human = state.humans.find(h => h.modelUuid === modelUuid);