EHS/include/ehs/io/mdl/KeyFrame.h

56 lines
983 B
C
Raw Normal View History

2024-02-05 22:25:30 -08:00
#pragma once
#include "ehs/EHS.h"
#include "ehs/Array.h"
#include "ehs/Vec3.h"
#include "ehs/Quat.h"
#include "ehs/Mat4.h"
#include "PropertyChange.h"
namespace ehs
{
2024-07-24 01:36:20 -07:00
class EHS_LIB_IO KeyFrame
2024-02-05 22:25:30 -08:00
{
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);
};
}