2023-12-17 03:29:08 -08:00
|
|
|
#pragma once
|
|
|
|
|
2023-12-17 15:00:08 -08:00
|
|
|
#include "EHS.h"
|
|
|
|
#include "Quat.h"
|
|
|
|
#include "Mat4.h"
|
2023-12-17 03:29:08 -08:00
|
|
|
|
2023-12-17 15:56:13 -08:00
|
|
|
namespace ehs
|
2023-12-17 03:29:08 -08:00
|
|
|
{
|
|
|
|
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();
|
|
|
|
};
|
|
|
|
}
|