matf-rg-engine 1.0.0
Base for project for the Computer Graphics course at Faculty of Mathematics, University of Belgrade
Loading...
Searching...
No Matches
Model.hpp
Go to the documentation of this file.
1
6#ifndef MATF_RG_PROJECT_MODEL_HPP
7#define MATF_RG_PROJECT_MODEL_HPP
9#include <algorithm>
10#include <utility>
11
12namespace engine::resources {
17 class Model {
18 friend class ResourcesController;
19
20 public:
25 void draw(const Shader *shader);
26
30 void destroy();
31
36 const std::vector<Mesh> &meshes() const {
37 return m_meshes;
38 }
39
44 const std::filesystem::path &path() const {
45 return m_path;
46 }
47
52 const std::string &name() const {
53 return m_name;
54 }
55
56 private:
60 std::vector<Mesh> m_meshes;
64 std::filesystem::path m_path;
68 std::string m_name;
69
70 Model() = default;
71
78 Model(std::vector<Mesh> meshes, std::filesystem::path path,
79 std::string name) : m_meshes(std::move(meshes))
80 , m_path(std::move(path))
81 , m_name(std::move(name)) {
82 }
83 };
84} // namespace engine
85
86#endif//MATF_RG_PROJECT_MODEL_HPP
Defines the Mesh class that serves as the interface for mesh rendering and storing processed assimp s...
Represents a model object within the OpenGL context as an array of Mesh objects.
Definition Model.hpp:17
const std::string & name() const
Returns the name of the model by which it can be referenced using the engine::resources::ResourcesCon...
Definition Model.hpp:52
const std::vector< Mesh > & meshes() const
Returns the meshes in the model.
Definition Model.hpp:36
std::vector< Mesh > m_meshes
The meshes in the model.
Definition Model.hpp:60
void draw(const Shader *shader)
Draws the model using a given shader by drawing all the meshes in the model.
Definition Model.cpp:6
std::string m_name
The name of the model by which it can be referenced using the engine::resources::ResourcesController:...
Definition Model.hpp:68
const std::filesystem::path & path() const
Returns the path to the model file from which the model was loaded.
Definition Model.hpp:44
void destroy()
Destroys the model in the OpenGL context.
Definition Model.cpp:12
Model(std::vector< Mesh > meshes, std::filesystem::path path, std::string name)
Constructs a Model object. Used internally by the engine::resources::ResourcesController class....
Definition Model.hpp:78
std::filesystem::path m_path
The path to the model file from which the model was loaded.
Definition Model.hpp:64
Manages app resources: Model, Texture, Shader, and Skybox.
Definition ResourcesController.hpp:21
Represents a linked shader program object within the OpenGL context.
Definition Shader.hpp:32
Definition GraphicsController.hpp:14