#pragma once #include "Mesh.hpp" #include "Shader.hpp" #include "Texture.hpp" #include #include #include #include #include namespace renderer { class Model { public: Model(); ~Model() = default; bool loadFromFile( const std::string &path ); size_t meshCount() const { return mMeshes.size(); } const glm::vec3 &getBoundsMin() const { return mBoundsMin; } const glm::vec3 &getBoundsMax() const { return mBoundsMax; } const std::vector< std::unique_ptr< Mesh > > &getMeshes() const { return mMeshes; } const std::vector< Texture > &getTextures() const { return mTextures; } const std::vector< Texture > &getNormalTextures() const { return mNormalTextures; } const std::vector< int > &getMeshTextureIndex() const { return mMeshToTex; } const std::vector< int > &getMeshNormalIndex() const { return mMeshToNormal; } private: bool processNode( aiNode *node, const aiScene *scene, const std::string &baseDir ); bool processMesh( aiMesh *mesh, const aiScene *scene, const std::string &baseDir, int &outTexIndex, int &outNormalIndex ); std::vector< std::unique_ptr< Mesh > > mMeshes; std::vector< Texture > mTextures; std::vector< Texture > mNormalTextures; std::vector< int > mMeshToTex; std::vector< int > mMeshToNormal; int mFallbackAlbedoIndex; int mFallbackNormalIndex; glm::vec3 mBoundsMin; glm::vec3 mBoundsMax; }; } // namespace renderer