update: add a physic scenne

This commit is contained in:
2026-04-17 10:48:18 +02:00
parent b26da614f0
commit ed7681a293
23 changed files with 2052 additions and 218 deletions
+17
View File
@@ -0,0 +1,17 @@
import { useEffect } from "react";
import type GUI from "lil-gui";
import { Debug } from "@/utils/debug/Debug";
export function useDebugFolder(
name: string,
setup: (folder: GUI) => void,
): void {
useEffect(() => {
const debug = Debug.getInstance();
if (!debug.active) return;
const folder = debug.createFolder(name);
if (!folder) return;
setup(folder);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
}
+18
View File
@@ -0,0 +1,18 @@
import { useEffect, useState } from "react";
import {
InteractionManager,
type InteractionSnapshot,
} from "@/stateManager/InteractionManager";
export function useInteraction(): InteractionSnapshot {
const manager = InteractionManager.getInstance();
const [state, setState] = useState<InteractionSnapshot>(manager.getState());
useEffect(() => {
return manager.subscribe(() => {
setState({ ...manager.getState() });
});
}, [manager]);
return state;
}