#ifndef MODEL_H #define MODEL_H #include "linear_alg.h" #include #include typedef uint16_t index_t; typedef struct { vec3_t position; vec3_t normal; u16_vec4_t bones; vec4_t weights; } vertex_t; typedef struct { uint32_t parent; vec3_t translation; vec4_t rotation; vec3_t scale; } bone_t; typedef struct { vec3_t *translations; vec4_t *rotations; vec3_t *scales; } animation_bone_t; typedef struct { float *times; size_t keyframe_count; animation_bone_t *bones; } animation_t; typedef struct { vertex_t *vertices; index_t *indices; bone_t *bones; mat4_t *inverse_bind_matrices; animation_t animation; size_t vertex_count; size_t index_count; size_t bone_count; } model_t; model_t model_init(size_t vertex_count, size_t index_count); void model_cleanup(model_t *m); #endif