EHS/include/io/model/Bone.h

74 lines
1.3 KiB
C++

#pragma once
#include "EHS.h"
#include "Quat.h"
#include "Mat4.h"
namespace ehs
{
class Bone
{
private:
UInt_64 hashName;
Str_8 name;
UInt_8 id;
Mat4_f animTrans;
Mat4_f localBindTrans;
Mat4_f invBindTrans;
Array<Bone> children;
public:
Bone();
Bone(Str_8 name, const UInt_8 id, const Mat4_f& localBindTrans, const Mat4_f& invBindTrans);
Bone(Bone&& bone) noexcept;
Bone(const Bone& bone);
Bone& operator=(Bone&& bone) noexcept;
Bone& operator=(const Bone& bone);
UInt_64 GetHashName() const;
void SetName(Str_8 newId);
Str_8 GetName() const;
UInt_8 GetId() const;
void SetAnimTrans(const Mat4_f& newTrans);
Mat4_f GetAnimTrans() const;
void GetAnimTransRec(Array<Mat4_f>& output) const;
Mat4_f GetLocalBindTrans() const;
Mat4_f GetInvBindTrans() const;
UInt_8 GetBoneCount() const;
bool HasBone(const UInt_64 hashName, const UInt_8 id) const;
bool HasBone(const UInt_64 hashName) const;
bool HasBone(const UInt_8 id) const;
bool AddBone(Bone child);
const Bone* GetBone(const UInt_64 hashName) const;
Bone* GetBone(const UInt_64 hashName);
const Bone* GetBone(const UInt_8 id) const;
Bone* GetBone(const UInt_8 id);
const Array<Bone>& GetChildren() const;
Array<Bone>& GetChildren();
};
}