#pragma once #include "../../EHS.h" #include "../../Array.h" #include "../File.h" #include "Mesh.h" #include "Bone.h" #include "Animation.h" namespace lwe { enum class ModelEncoding : UInt_8 { EHM }; class Model : public Resource { protected: 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; bool UploadToGpu(GpuCmdBuffer* cmdBuffer) override; bool PostGpuUpload() override; bool ReleaseFromGpu() override; bool IsUploaded() const override; void Draw(GpuCmdBuffer* cmdBuffer, const UInt_32 instances = 1); Array GetMeshes() const; Array& GetMeshes(); Mesh* GetMesh(const UInt_64 hashId); Mesh* GetMesh(const Str_8& id); Bone GetSkeleton() const; Bone& GetSkeleton(); Animation* GetAnimation(const UInt_64 hashId); Array GetAnimations() const; Array& GetAnimations(); void Calculate(); void Export(const Str_8& filePath, const ModelEncoding encoding); private: void ToEHM(File& file); void FromEHM(File& file); }; }