diff --git a/.agent/skills/debug.md b/.agent/skills/debug.md index 0e44edd..f000409 100644 --- a/.agent/skills/debug.md +++ b/.agent/skills/debug.md @@ -8,6 +8,8 @@ Append `?debug` to the URL: http://localhost:5173?debug ``` +The free debug camera is toggled from the debug panel, not mounted permanently. + ## Debug singleton ```ts diff --git a/README.md b/README.md index 9c96f46..96487db 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ npm run dev ``` Open `http://localhost:5173` — standard experience. -Open `http://localhost:5173?debug` — debug panel + r3f-perf overlay + free debug camera. +Open `http://localhost:5173?debug` — debug panel + r3f-perf overlay. The free debug camera is enabled from the debug panel. ## 🧭 Conventions diff --git a/src/App.tsx b/src/App.tsx index dcc621e..6b30f8e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,13 +1,17 @@ import { Canvas } from "@react-three/fiber"; +import { Crosshair } from "@/components/ui/Crosshair"; import { DebugPerf } from "@/debug/DebugPerf"; import { World } from "@/world/World"; function App(): React.JSX.Element { return ( - - - - + <> + + + + + + ); } diff --git a/src/components/ui/Crosshair.tsx b/src/components/ui/Crosshair.tsx new file mode 100644 index 0000000..e43affd --- /dev/null +++ b/src/components/ui/Crosshair.tsx @@ -0,0 +1,11 @@ +import { useCameraMode } from "@/debug/useCameraMode"; + +export function Crosshair(): React.JSX.Element | null { + const cameraMode = useCameraMode(); + + if (cameraMode !== "player") { + return null; + } + + return