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
@@ -0,0 +1,19 @@
import { create } from "zustand";
interface DebugVisualsStore {
showPlayerModel: boolean;
setShowPlayerModel: (value: boolean) => void;
showOctree: boolean;
setShowOctree: (value: boolean) => void;
octreeMaxDepth: number;
setOctreeMaxDepth: (value: number) => void;
}
export const useDebugVisualsStore = create<DebugVisualsStore>((set) => ({
showPlayerModel: false,
setShowPlayerModel: (showPlayerModel) => set({ showPlayerModel }),
showOctree: false,
setShowOctree: (showOctree) => set({ showOctree }),
octreeMaxDepth: 6,
setOctreeMaxDepth: (octreeMaxDepth) => set({ octreeMaxDepth }),
}));