diff options
author | quou <quou@disroot.org> | 2024-12-29 13:40:55 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-12-29 13:41:56 +1100 |
commit | 928eba3845d6017d133048cf04c1f816d87941b0 (patch) | |
tree | 50f8c52b6f6eb0adbde2666c50ff10dd3920616a /model.hpp | |
parent | 7383cfcbe8ade4dce057608e971e8cb7d4b1feb7 (diff) |
model hierarchy support
Diffstat (limited to 'model.hpp')
-rw-r--r-- | model.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -2,17 +2,23 @@ #define model_hpp #include "asset.hpp" +#include "maths.hpp" #include "video.hpp" +struct Model; struct Mesh { int offset, vbo_offset, count; - int parent; + int parent, mesh_binding, mvp_binding; + bool world_dirty; + m4f local, world; Shader_Id shader; + const m4f& get_world(Model& m); }; struct Model : public Asset { Buffer_Id vbo; Buffer_Id ibo; + Buffer_Id mvp; int mesh_count; Mesh* get_meshes() { @@ -20,11 +26,13 @@ struct Model : public Asset { } void destroy(Device* dev); + void update_transforms(); void render( Device* dev, Arena* a, Render_Pass& pass, - Buffer_Id config + const m4f& transform, + const m4f& view_projection ); }; |