diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-06 06:51:16 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-06 06:51:16 +0100 |
| commit | b68c8d8cbe9274e42a89888186152d4ded1a2962 (patch) | |
| tree | 0d0d64ecaad2dadd29a4eff3daeb96867437d1ae /src/util/asset_manager.h | |
| parent | 32a6d4f516b2ff45e25ddc7870e5400c2973fb9a (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/util/asset_manager.h')
| -rw-r--r-- | src/util/asset_manager.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/util/asset_manager.h b/src/util/asset_manager.h index a78447d..0c2cc63 100644 --- a/src/util/asset_manager.h +++ b/src/util/asset_manager.h @@ -39,6 +39,22 @@ struct TextureAsset { const uint8_t* pixels; }; +struct MeshVertex { + float p[3]; + float n[3]; + float u[2]; +}; + +struct MeshAsset { + uint32_t num_vertices; + const MeshVertex* vertices; + uint32_t num_indices; + const uint32_t* indices; +}; + // Helper to retrieve and parse a simple texture asset (from packer's // [w][h][pixels] format) TextureAsset GetTextureAsset(AssetId asset_id); + +// Helper to retrieve and parse a mesh asset (from packer's binary format) +MeshAsset GetMeshAsset(AssetId asset_id); |
