#ifndef __SCOPE_RENDERER_MODEL__ #define __SCOPE_RENDERER_MODEL__ #include #include #include #include #include #include namespace Scop { // Only static meshes for now class Model { friend Model LoadModelFromObjFile(std::filesystem::path path) noexcept; public: Model() = default; Model(std::shared_ptr mesh); inline void SetMaterial(std::shared_ptr material, std::size_t mesh_index) { m_materials[mesh_index] = material; } inline std::size_t GetSubMeshCount() const { return p_mesh->GetSubMeshCount(); } [[nodiscard]] inline std::shared_ptr GetMaterial(std::size_t mesh_index) { return m_materials[mesh_index]; } [[nodiscard]] inline std::vector>& GetAllMaterials() { return m_materials; } [[nodiscard]] inline Vec3f GetCenter() const noexcept { return m_center; } void Draw(VkCommandBuffer cmd, const DescriptorSet& matrices_set, const class GraphicPipeline& pipeline, DescriptorSet& set, std::size_t& drawcalls, std::size_t& polygondrawn, std::size_t frame_index) const; ~Model() = default; private: Vec3f m_center = { 0.0f, 0.0f, 0.0f }; std::vector> m_materials; std::shared_ptr p_mesh; }; Model LoadModelFromObjFile(std::filesystem::path path) noexcept; } #endif