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:
@@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user