From 928eba3845d6017d133048cf04c1f816d87941b0 Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 29 Dec 2024 13:40:55 +1100 Subject: model hierarchy support --- model.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'model.hpp') 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 ); }; -- cgit v1.2.3-54-g00ecf