summaryrefslogtreecommitdiff
path: root/src/3d/visual_debug.h
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-06 08:05:20 +0100
committerskal <pascal.massimino@gmail.com>2026-02-06 08:05:20 +0100
commit8ded2005d441f8aab44c833fc658d9622c788ebd (patch)
treeefaf714b636788148db583903bfbff3b015f3f58 /src/3d/visual_debug.h
parent1ec5d1ae48d1dd3290992ba63a8ec581af02b9dd (diff)
feat(tests): Add test_mesh tool for OBJ loading and normal visualization
Implemented a new standalone test tool 'test_mesh' to: - Load a .obj file specified via command line. - Display the mesh with rotation and basic lighting on a tiled floor. - Provide a '--debug' option to visualize vertex normals as cyan lines. - Updated asset_packer to auto-generate smooth normals for OBJs if missing. - Fixed various WGPU API usage inconsistencies and build issues on macOS. - Exposed Renderer3D::GetVisualDebug() for test access. - Added custom Vec3 struct and math utilities for OBJ parsing. This tool helps verify mesh ingestion and normal computation independently of the main demo logic.
Diffstat (limited to 'src/3d/visual_debug.h')
-rw-r--r--src/3d/visual_debug.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/3d/visual_debug.h b/src/3d/visual_debug.h
index 6173fc4..ebccf45 100644
--- a/src/3d/visual_debug.h
+++ b/src/3d/visual_debug.h
@@ -8,6 +8,7 @@
#include "gpu/gpu.h"
#include "util/mini_math.h"
+#include "3d/object.h"
#include <vector>
struct DebugLine {
@@ -27,6 +28,8 @@ class VisualDebug {
void add_aabb(const vec3& min, const vec3& max, const vec3& color);
+ void add_mesh_normals(const mat4& transform, uint32_t num_vertices, const MeshVertex* vertices);
+
// Render all queued primitives and clear the queue
void render(WGPURenderPassEncoder pass, const mat4& view_proj);