feat: Create a debug mode that visualizes all collision boxes and light sources (#150)
Some checks failed
CI / validate (pull_request) Failing after 6s
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:
20
app.js
20
app.js
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user