2023-12-17 03:29:08 -08:00
|
|
|
#pragma once
|
|
|
|
|
2023-12-17 15:00:08 -08:00
|
|
|
#include "EHS.h"
|
|
|
|
#include "Array.h"
|
|
|
|
#include "Vec3.h"
|
|
|
|
#include "Quat.h"
|
|
|
|
#include "Mat4.h"
|
2023-12-17 03:29:08 -08:00
|
|
|
#include "PropertyChange.h"
|
|
|
|
|
2023-12-17 15:56:13 -08:00
|
|
|
namespace ehs
|
2023-12-17 03:29:08 -08:00
|
|
|
{
|
|
|
|
class KeyFrame
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
float num;
|
|
|
|
float timeStamp;
|
|
|
|
Vec3_f pos;
|
|
|
|
Quat_f rot;
|
|
|
|
Vec3_f scale;
|
|
|
|
Mat4_f trans;
|
|
|
|
|
|
|
|
public:
|
|
|
|
KeyFrame();
|
|
|
|
|
|
|
|
KeyFrame(const float num, const float timeStamp, const Vec3_f& pos, const Quat_f& rot, const Vec3_f& scale);
|
|
|
|
|
|
|
|
KeyFrame(const float num, const float timeStamp);
|
|
|
|
|
|
|
|
KeyFrame(const KeyFrame& kf);
|
|
|
|
|
|
|
|
KeyFrame& operator=(const KeyFrame& kf);
|
|
|
|
|
|
|
|
float GetNum() const;
|
|
|
|
|
|
|
|
float GetTimeStamp() const;
|
|
|
|
|
|
|
|
void SetPos(const Vec3_f& newPos);
|
|
|
|
|
|
|
|
Vec3_f GetPos() const;
|
|
|
|
|
|
|
|
void SetRot(const Quat_f& newRot);
|
|
|
|
|
|
|
|
Quat_f GetRot() const;
|
|
|
|
|
|
|
|
void SetScale(const Vec3_f& newScale);
|
|
|
|
|
|
|
|
Vec3_f GetScale() const;
|
|
|
|
|
|
|
|
void CalculateTransform();
|
|
|
|
|
|
|
|
Mat4_f GetTrans() const;
|
|
|
|
|
|
|
|
static Mat4_f Interpolate(const KeyFrame& prev, const KeyFrame& next, const float percentage);
|
|
|
|
};
|
|
|
|
}
|