#ifndef model_h #define model_h #include "prbm.h" #include "arena.h" #define pos_loc 0 #define norm_loc 1 #define texc_loc 2 #define proj_matrix_name "proj" #define view_matrix_name "view" #define model_matrix_name "model" struct vertex { v3 pos; v3 norm; v2 texc; }; struct mesh { v3 pos; v3 angles; v3 scale; i32 nvertices; struct vertex *vertices; i32 nindices; u32 *indices; struct texture *texture; u32 vao; u32 vbo; u32 ebo; }; struct model { v3 pos; v3 angles; v3 scale; i32 nmeshes; struct mesh *meshes; }; mat get_model_matrix(v3 pos, v3 angles, v3 scale); struct mesh init_mesh(v3 pos, v3 angles, v3 scale, i32 nvertices, struct vertex *vertices, i32 nindices, u32 *indices, struct texture *texture); void clear_mesh(struct mesh *mesh); struct mesh gen_quad(struct arena *arena, v3 pos, v3 angles, v3 scale, f32 width, f32 height); struct model init_model(v3 pos, v3 angles, v3 scale, i32 nmeshes, struct mesh *meshes); #endif