39 lines
947 B
C++
39 lines
947 B
C++
#ifndef SKELETALANIMATION_H
|
|
#define SKELETALANIMATION_H
|
|
|
|
#include <map>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include <glm/gtc/quaternion.hpp>
|
|
#include <glm/vec3.hpp>
|
|
#include <destrum/Assets/AssetReference.h>
|
|
|
|
struct SkeletalAnimation {
|
|
AssetReference assetReference;
|
|
|
|
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
|