summaryrefslogtreecommitdiff
path: root/model.hpp
diff options
context:
space:
mode:
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
);
};