feat(debug): add player model and octree visualization toggles

- Show Player Model: render the main character GLTF in camera-local
  space so it stays visible at any pitch.
- Show Octree: overlay the collision octree as colored line segments,
  one wireframe per spatial cell, colored by depth.
- Octree Max Depth: cap recursion to keep the scene readable.
This commit is contained in:
Tom Boullay
2026-06-01 14:14:20 +02:00
parent 777e51efeb
commit fd0b9e2749
4 changed files with 247 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
import { useDebugFolder } from "@/hooks/debug/useDebugFolder";
import { useDebugVisualsStore } from "@/managers/stores/useDebugVisualsStore";
export function useDebugVisualsDebug(): void {
useDebugFolder("Debug", (folder) => {
const controls = {
showPlayerModel: useDebugVisualsStore.getState().showPlayerModel,
showOctree: useDebugVisualsStore.getState().showOctree,
octreeMaxDepth: useDebugVisualsStore.getState().octreeMaxDepth,
};
folder
.add(controls, "showPlayerModel")
.name("Show Player Model")
.onChange((value: boolean) => {
useDebugVisualsStore.getState().setShowPlayerModel(value);
});
folder
.add(controls, "showOctree")
.name("Show Octree")
.onChange((value: boolean) => {
useDebugVisualsStore.getState().setShowOctree(value);
});
folder
.add(controls, "octreeMaxDepth", 0, 10, 1)
.name("Octree Max Depth")
.onChange((value: number) => {
useDebugVisualsStore.getState().setOctreeMaxDepth(value);
});
});
}