fix hand tracking glove rendering
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { create } from "zustand";
|
||||
|
||||
export type HandTrackingGloveHandedness = "left" | "right";
|
||||
|
||||
type HandTrackingGloveLoadState = "idle" | "loaded" | "error";
|
||||
|
||||
interface HandTrackingGloveStatusState {
|
||||
gloves: Record<HandTrackingGloveHandedness, HandTrackingGloveLoadState>;
|
||||
setGloveStatus: (
|
||||
handedness: HandTrackingGloveHandedness,
|
||||
status: HandTrackingGloveLoadState,
|
||||
) => void;
|
||||
}
|
||||
|
||||
export const useHandTrackingGloveStatus =
|
||||
create<HandTrackingGloveStatusState>()((set) => ({
|
||||
gloves: {
|
||||
left: "idle",
|
||||
right: "idle",
|
||||
},
|
||||
setGloveStatus: (handedness, status) =>
|
||||
set((state) => ({
|
||||
gloves: {
|
||||
...state.gloves,
|
||||
[handedness]: status,
|
||||
},
|
||||
})),
|
||||
}));
|
||||
Reference in New Issue
Block a user