56 lines
982 B
C
56 lines
982 B
C
|
#pragma once
|
||
|
|
||
|
#include "../../EHS.h"
|
||
|
#include "../../Array.h"
|
||
|
#include "../../Vec3.h"
|
||
|
#include "../../Quat.h"
|
||
|
#include "../../Mat4.h"
|
||
|
#include "PropertyChange.h"
|
||
|
|
||
|
namespace lwe
|
||
|
{
|
||
|
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);
|
||
|
};
|
||
|
}
|