summaryrefslogtreecommitdiff
path: root/model.hpp
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-12-29 13:40:55 +1100
committerquou <quou@disroot.org>2024-12-29 13:41:56 +1100
commit928eba3845d6017d133048cf04c1f816d87941b0 (patch)
tree50f8c52b6f6eb0adbde2666c50ff10dd3920616a /model.hpp
parent7383cfcbe8ade4dce057608e971e8cb7d4b1feb7 (diff)
model hierarchy support
Diffstat (limited to 'model.hpp')
-rw-r--r--model.hpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/model.hpp b/model.hpp
index d4c4be3..0242cd0 100644
--- a/model.hpp
+++ b/model.hpp
@@ -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
);
};