Rework bone and animation structure

This commit is contained in:
Camden Dixie O'Brien committed 2025-10-02 15:32:46 +01:00
1 parent ffa0beb55a
commit 2a603dc364
3 files changed
+74 -79

No files matched your search

+5 -12
View File
@@ -3,8 +3,8 @@
#include "linear_alg.h"
#include <stdint.h>
#include <stddef.h>
#include <stdint.h>
typedef uint16_t index_t;
@@ -16,28 +16,21 @@ typedef struct {
} 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;
uint32_t *times_us;
bone_t *keyframes;
size_t length_us, keyframe_count;
} animation_t;
typedef struct {
vertex_t *vertices;
index_t *indices;
bone_t *bones;
uint32_t *bone_parents;
mat4_t *inverse_bind_matrices;
animation_t animation;
size_t vertex_count;