Added skeletal animations and other fixes
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user