#ifndef MODEL_COMPONENT_H #define MODEL_COMPONENT_H #include #include #include #include // Structure representing a single vertex. struct Vertex { glm::vec3 Position; glm::vec3 Normal; glm::vec2 TexCoords; glm::vec3 Tangent; }; class ModelComponent { public: ModelComponent(); ~ModelComponent(); // Material properties. glm::vec3 diffuseColor; glm::vec3 specularColor; float shininess; // Mesh data. std::vector vertices; std::vector indices; // OpenGL buffers. GLuint VAO, VBO, EBO; // Texture handles. GLuint diffuseTexture; GLuint normalTexture; // Set up the mesh by creating VAO, VBO, and EBO. void SetupMesh(); // Load textures from file. bool LoadDiffuseTexture(const std::string &filepath); bool LoadNormalTexture(const std::string &filepath); // Draw the mesh. void Draw(); }; #endif // MODEL_COMPONENT_H