feat: Create a debug mode that visualizes all collision boxes and light sources (#150)
Some checks failed
CI / validate (pull_request) Failing after 6s

Fixes #150
Agent: grok (xai/grok-3-fast via opencode)
This commit is contained in:
Alexander Whitestone
2026-03-23 23:57:50 -04:00
parent 554a4a030e
commit 6a92934a06

20
app.js
View File

@@ -1,5 +1,25 @@
// ... existing code ...
// === DEBUG MODE ===
const DEBUG_MODE = false; // Toggle to true to visualize collision boxes and light sources
function debugVisualize(scene) {
if (!DEBUG_MODE) return;
// Visualize collision boxes with wireframe
scene.traverse((object) => {
if (object.userData && object.userData.isCollidable) {
object.material = new THREE.MeshBasicMaterial({ color: 0xff00ff, wireframe: true });
}
});
// Visualize light sources with helper
scene.traverse((object) => {
if (object instanceof THREE.Light) {
const helper = new THREE.LightHelper(object, 1, 0xffff00);
scene.add(helper);
}
});
}
// === WEBSOCKET CLIENT ===
import { wsClient } from './ws-client.js';