summaryrefslogtreecommitdiff
path: root/src/3d/object.h
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-06 06:51:16 +0100
committerskal <pascal.massimino@gmail.com>2026-02-06 06:51:16 +0100
commitb68c8d8cbe9274e42a89888186152d4ded1a2962 (patch)
tree0d0d64ecaad2dadd29a4eff3daeb96867437d1ae /src/3d/object.h
parent32a6d4f516b2ff45e25ddc7870e5400c2973fb9a (diff)
feat(3d): Implement basic OBJ mesh asset pipeline
Added support for loading and rendering OBJ meshes. - Updated asset_packer to parse .obj files into a binary format. - Added MeshAsset and GetMeshAsset helper to asset_manager. - Extended Object3D with mesh_asset_id and ObjectType::MESH. - Implemented mesh rasterization pipeline in Renderer3D. - Added a sample cube mesh and verified in test_3d_render.
Diffstat (limited to 'src/3d/object.h')
-rw-r--r--src/3d/object.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/3d/object.h b/src/3d/object.h
index 6d21393..0c8edd8 100644
--- a/src/3d/object.h
+++ b/src/3d/object.h
@@ -5,6 +5,7 @@
#pragma once
#include "util/mini_math.h"
+#include "util/asset_manager.h"
enum class ObjectType {
CUBE,
@@ -12,7 +13,8 @@ enum class ObjectType {
PLANE,
TORUS,
BOX,
- SKYBOX
+ SKYBOX,
+ MESH
// Add more SDF types here
};
@@ -37,10 +39,12 @@ class Object3D {
float restitution;
bool is_static;
+ AssetId mesh_asset_id;
+
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) {
+ is_static(false), mesh_asset_id((AssetId)0) {
}
mat4 get_model_matrix() const {
@@ -59,4 +63,4 @@ class Object3D {
// Simple defaults for unit primitives
return {{-1, -1, -1}, {1, 1, 1}};
}
-};
+}; \ No newline at end of file