Rendering Engine 0.2.9
Modular Graphics Rendering Engine | v0.2.9
rendering_engine::ModelMaterial Class Reference

Represents a single material imported from a 3D model file. More...

#include <model_material.hpp>

Public Member Functions

 ModelMaterial (Model &model)
 Constructs an empty material associated with a model. More...
 
 ModelMaterial (const ModelMaterial &)=default
 
ModelMaterialoperator= (const ModelMaterial &)=default
 
 ModelMaterial (ModelMaterial &&)=default
 
ModelMaterialoperator= (ModelMaterial &&)=default
 
 ~ModelMaterial ()=default
 
ModelGetModel ()
 Returns a reference to the owning Model. More...
 
const std::string & Name () const
 Gets the material name as defined in the source file. More...
 
const std::map< TextureType, std::vector< std::string > > Textures () const
 Retrieves the list of textures associated with each texture type. More...
 

Friends

class Model
 

Detailed Description

Represents a single material imported from a 3D model file.

A ModelMaterial acts as a lightweight wrapper around Assimp's aiMaterial, extracting and storing references to texture file paths per texture type.

Note
Multiple meshes within a model may reference the same ModelMaterial.
See also
Model, TextureType

Definition at line 52 of file model_material.hpp.

Constructor & Destructor Documentation

◆ ModelMaterial() [1/3]

rendering_engine::ModelMaterial::ModelMaterial ( Model model)
explicit

Constructs an empty material associated with a model.

Parameters
modelReference to the owning Model instance.

Definition at line 20 of file model_material.cpp.

21 :
22 mModel(&model)
23{
24}

◆ ModelMaterial() [2/3]

rendering_engine::ModelMaterial::ModelMaterial ( const ModelMaterial )
default

◆ ModelMaterial() [3/3]

rendering_engine::ModelMaterial::ModelMaterial ( ModelMaterial &&  )
default

◆ ~ModelMaterial()

rendering_engine::ModelMaterial::~ModelMaterial ( )
default

Member Function Documentation

◆ GetModel()

Model & rendering_engine::ModelMaterial::GetModel ( )

Returns a reference to the owning Model.

Returns
Reference to the parent Model instance.

Definition at line 26 of file model_material.cpp.

27{
28 return *mModel;
29}

◆ Name()

const std::string & rendering_engine::ModelMaterial::Name ( ) const

Gets the material name as defined in the source file.

Returns
Material name string.

Definition at line 31 of file model_material.cpp.

32{
33 return mName;
34}

◆ operator=() [1/2]

ModelMaterial & rendering_engine::ModelMaterial::operator= ( const ModelMaterial )
default

◆ operator=() [2/2]

ModelMaterial & rendering_engine::ModelMaterial::operator= ( ModelMaterial &&  )
default

◆ Textures()

const std::map< TextureType, std::vector< std::string > > rendering_engine::ModelMaterial::Textures ( ) const

Retrieves the list of textures associated with each texture type.

Each entry in the map corresponds to one TextureType key (e.g., Diffuse, NormalMap) and a list of texture file paths associated with that type.

Returns
A map of texture types to vectors of texture file paths.

Definition at line 36 of file model_material.cpp.

37{
38 return mTextures;
39}

Friends And Related Function Documentation

◆ Model

friend class Model
friend

Definition at line 54 of file model_material.hpp.


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