#pragma once #include "ehs/EHS.h" #include "ehs/Array.h" #include "ehs/io/File.h" #include "Mesh.h" #include "Bone.h" #include "Animation.h" namespace ehs { enum class ModelEncoding : UInt_8 { EHM }; class Model : public BaseObj { protected: UInt_64 hashId; Str_8 id; Array meshes; Bone skeleton; Array animations; public: Model(); Model(const Str_8& filePath); Model(Str_8 id, Array meshes, Bone skeleton, Array animations); Model(Str_8 id, Array meshes, Bone skeleton); Model(Str_8 id, Array meshes); Model(Model&& model) noexcept; Model(const Model& model) = default; Model& operator=(Model&& model) noexcept; Model& operator=(const Model& model) = default; void Release(); UInt_64 GetHashId() const; void SetId(Str_8 newId); Str_8 GetId() const; const Array& GetMeshes() const; Array& GetMeshes(); Mesh* GetMesh(UInt_64 inHashId); Mesh* GetMesh(const Str_8& inId); const Bone& GetSkeleton() const; Bone& GetSkeleton(); Animation* GetAnimation(UInt_64 inHashId); const Array& GetAnimations() const; Array& GetAnimations(); void Calculate(); void Export(const Str_8& filePath, ModelEncoding encoding); private: void ToEHM(File& file); void FromEHM(File& file); }; }