summaryrefslogtreecommitdiff
path: root/src/3d/object.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/object.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/object.h')
-rw-r--r--src/3d/object.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/3d/object.h b/src/3d/object.h
index 0c8edd8..a7ce0b8 100644
--- a/src/3d/object.h
+++ b/src/3d/object.h
@@ -40,11 +40,12 @@ class Object3D {
bool is_static;
AssetId mesh_asset_id;
+ void* user_data; // For tool-specific data, not for general use
Object3D(ObjectType t = ObjectType::CUBE)
: position(0, 0, 0), rotation(0, 0, 0, 1), scale(1, 1, 1), type(t),
color(1, 1, 1, 1), velocity(0, 0, 0), mass(1.0f), restitution(0.5f),
- is_static(false), mesh_asset_id((AssetId)0) {
+ is_static(false), mesh_asset_id((AssetId)0), user_data(nullptr) {
}
mat4 get_model_matrix() const {