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
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
engine::resources::Model Class Reference

Represents a model object within the OpenGL context as an array of Mesh objects. More...

#include <Model.hpp>

Public Member Functions

void draw (const Shader *shader)
 Draws the model using a given shader by drawing all the meshes in the model.
 
void destroy ()
 Destroys the model in the OpenGL context.
 
const std::vector< Mesh > & meshes () const
 Returns the meshes in the model.
 
const std::filesystem::path & path () const
 Returns the path to the model file from which the model was loaded.
 
const std::string & name () const
 Returns the name of the model by which it can be referenced using the engine::resources::ResourcesController::model function.
 

Private Member Functions

 Model ()=default
 
 Model (std::vector< Mesh > meshes, std::filesystem::path path, std::string name)
 Constructs a Model object. Used internally by the engine::resources::ResourcesController class. You are not supposed to call this constructor directly from user code.
 

Private Attributes

std::vector< Meshm_meshes
 The meshes in the model.
 
std::filesystem::path m_path
 The path to the model file from which the model was loaded.
 
std::string m_name
 The name of the model by which it can be referenced using the engine::resources::ResourcesController::model function.
 

Friends

class ResourcesController
 

Detailed Description

Represents a model object within the OpenGL context as an array of Mesh objects.

Constructor & Destructor Documentation

◆ Model() [1/2]

engine::resources::Model::Model ( )
privatedefault

◆ Model() [2/2]

engine::resources::Model::Model ( std::vector< Mesh meshes,
std::filesystem::path  path,
std::string  name 
)
inlineprivate

Constructs a Model object. Used internally by the engine::resources::ResourcesController class. You are not supposed to call this constructor directly from user code.

Parameters
meshesThe meshes in the model.
pathThe path to the model file from which the model was loaded.
nameThe name of the model by which it can be referenced using the engine::resources::ResourcesController::model function.

Member Function Documentation

◆ draw()

void engine::resources::Model::draw ( const Shader shader)

Draws the model using a given shader by drawing all the meshes in the model.

Parameters
shaderThe shader to use for drawing.

◆ destroy()

void engine::resources::Model::destroy ( )

Destroys the model in the OpenGL context.

◆ meshes()

const std::vector< Mesh > & engine::resources::Model::meshes ( ) const
inline

Returns the meshes in the model.

Returns
The meshes in the model.

◆ path()

const std::filesystem::path & engine::resources::Model::path ( ) const
inline

Returns the path to the model file from which the model was loaded.

Returns
The path to the model.

◆ name()

const std::string & engine::resources::Model::name ( ) const
inline

Returns the name of the model by which it can be referenced using the engine::resources::ResourcesController::model function.

Returns
The name of the model.

Friends And Related Symbol Documentation

◆ ResourcesController

friend class ResourcesController
friend

Member Data Documentation

◆ m_meshes

std::vector<Mesh> engine::resources::Model::m_meshes
private

The meshes in the model.

◆ m_path

std::filesystem::path engine::resources::Model::m_path
private

The path to the model file from which the model was loaded.

◆ m_name

std::string engine::resources::Model::m_name
private

The name of the model by which it can be referenced using the engine::resources::ResourcesController::model function.


The documentation for this class was generated from the following files: