diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-08 21:28:40 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-08 21:28:40 +0100 |
| commit | d3a609fad91744c45f6bc59b625a26f8870e271d (patch) | |
| tree | 002b224a216f0710cb6df9823570814628b05203 /doc/archive/VISUAL_DEBUG.md | |
| parent | f6324b0b5d65aef6e713e8b902a6b689659dd27f (diff) | |
docs: Archive historical documentation (26 files → doc/archive/)
Moved completed/historical docs to doc/archive/ for cleaner context:
Archived (26 files):
- Analysis docs: variable tempo, audio architecture, build optimization
- Handoff docs: 6 agent handoff documents
- Debug reports: shadows, peak meter, timing fixes
- Task summaries and planning docs
Kept (16 files):
- Essential: AI_RULES, HOWTO, CONTRIBUTING, CONTEXT_MAINTENANCE
- Active subsystems: 3D, ASSET_SYSTEM, TRACKER, SEQUENCE
- Current work: MASKING_SYSTEM, SPECTRAL_BRUSH_EDITOR
Updated COMPLETED.md with archive index for easy reference.
Diffstat (limited to 'doc/archive/VISUAL_DEBUG.md')
| -rw-r--r-- | doc/archive/VISUAL_DEBUG.md | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/doc/archive/VISUAL_DEBUG.md b/doc/archive/VISUAL_DEBUG.md new file mode 100644 index 0000000..f0adcba --- /dev/null +++ b/doc/archive/VISUAL_DEBUG.md @@ -0,0 +1,48 @@ +# Visual Debugging System + +The `VisualDebug` class provides immediate-mode style 3D wireframe rendering for debugging purposes. It is stripped from the final binary when `STRIP_ALL` is defined. + +## Features + +- **Wireframe Primitives**: Boxes, AABBs, Spheres, Cones, Crosses, Lines. +- **Trajectories**: Visualize paths with `add_trajectory`. +- **Mesh Normals**: Visualize vertex normals. +- **Zero Overhead**: Code is compiled out in release builds. + +## Usage + +Access the instance via `Renderer3D::GetVisualDebug()` (only available if `!STRIP_ALL`). + +```cpp +#if !defined(STRIP_ALL) + VisualDebug& dbg = renderer.GetVisualDebug(); + + // Draw a red box at origin + dbg.add_box(mat4::identity(), vec3(1,1,1), vec3(1,0,0)); + + // Draw a trajectory + std::vector<vec3> path = { ... }; + dbg.add_trajectory(path, vec3(0,1,0)); + + // Draw a light cone + dbg.add_cone(light_pos, light_dir, range, radius, vec3(1,1,0)); +#endif +``` + +## Primitives + +- `add_line(start, end, color)`: Basic line segment. +- `add_cross(center, size, color)`: 3D cross (useful for points). +- `add_sphere(center, radius, color)`: Wireframe sphere (3 axis circles). +- `add_cone(apex, dir, height, radius, color)`: Wireframe cone (useful for spotlights). +- `add_box(transform, half_extent, color)`: OBB. +- `add_aabb(min, max, color)`: Axis-aligned box. +- `add_trajectory(points, color)`: Polyline. + +## Integration + +The `VisualDebug::render` method is called automatically by `Renderer3D::draw` if `s_debug_enabled_` is true. +To enable globally: +```cpp +Renderer3D::SetDebugEnabled(true); +``` |
