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

56 lines
983 B
C++

#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
{
class EHS_LIB_IO 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);
};
}