Rendering Engine 0.2.0
Modular Graphics Rendering Engine | v0.2.0
Loading...
Searching...
No Matches
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.
 ModelMaterial (const ModelMaterial &)=default
ModelMaterialoperator= (const ModelMaterial &)=default
 ModelMaterial (ModelMaterial &&)=default
ModelMaterialoperator= (ModelMaterial &&)=default
 ~ModelMaterial ()=default
ModelGetModel ()
 Returns a reference to the owning Model.
const std::string & Name () const
 Gets the material name as defined in the source file.
const std::map< TextureType, std::vector< std::string > > Textures () const
 Retrieves the list of textures associated with each texture type.

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 51 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 21 of file model_material.cpp.

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

◆ 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 27 of file model_material.cpp.

28{
29 return *mModel;
30}

◆ 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 32 of file model_material.cpp.

33{
34 return mName;
35}

◆ 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 37 of file model_material.cpp.

38{
39 return mTextures;
40}

◆ Model

friend class Model
friend

Definition at line 53 of file model_material.hpp.


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