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

+6 -11
View File
@@ -34,18 +34,13 @@ void model_cleanup(model_t *m)
free(m->inverse_bind_matrices);
m->inverse_bind_matrices = nullptr;
}
if (m->animation.times != nullptr) {
free(m->animation.times);
m->animation.times = nullptr;
if (m->animation.times_us != nullptr) {
free(m->animation.times_us);
m->animation.times_us = nullptr;
}
if (m->animation.bones != nullptr) {
for (unsigned i = 0; i < m->bone_count; ++i) {
free(m->animation.bones[i].translations);
free(m->animation.bones[i].rotations);
free(m->animation.bones[i].scales);
}
free(m->animation.bones);
m->animation.bones = nullptr;
if (m->animation.keyframes != nullptr) {
free(m->animation.keyframes);
m->animation.keyframes = nullptr;
}
m->vertex_count = m->index_count = m->bone_count
= m->animation.keyframe_count = 0;