Added skeletal animations and other fixes

This commit is contained in:
2026-03-16 12:57:53 +01:00
parent 2cc18b3329
commit 28c6703892
51 changed files with 1964 additions and 602 deletions
@@ -0,0 +1,35 @@
#ifndef SKELETALANIMATION_H
#define SKELETALANIMATION_H
#include <map>
#include <string>
#include <vector>
#include <glm/gtc/quaternion.hpp>
#include <glm/vec3.hpp>
struct SkeletalAnimation {
struct Keyframe {
float time;
glm::vec3 translation;
glm::quat rotation;
glm::vec3 scale;
};
struct Track {
std::uint32_t jointIndex;
std::vector<Keyframe> keyframes; // sorted by time
};
std::vector<Track> tracks; // one per animated joint (not all joints need a track)
float duration{0.f};
bool looped{true};
std::string name;
int startFrame{0};
std::map<int, std::vector<std::string>> events;
const std::vector<std::string>& getEventsForFrame(int frame) const;
};
#endif // SKELETALANIMATION_H