2#include "assimp/scene.h"
6const std::map<TextureType, uint32_t> ModelMaterial::sTextureTypeMappings =
46 material.Get(AI_MATKEY_NAME, name);
51 aiTextureType mappedTextureType =
static_cast<aiTextureType
>(sTextureTypeMappings.at(textureType));
53 uint32_t textureCount = material.GetTextureCount(mappedTextureType);
54 if( textureCount > 0 )
56 std::vector<std::string> textures;
57 textures.reserve(textureCount);
58 for( uint32_t textureIndex = 0; textureIndex < textureCount; textureIndex++ )
61 if( material.GetTexture(mappedTextureType, textureIndex, &path) == AI_SUCCESS )
63 textures.push_back(path.C_Str());
66 mTextures.emplace(textureType, move(textures));
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.
ModelMaterial(Model &model)
Constructs an empty material associated with a model.
Model & GetModel()
Returns a reference to the owning Model.
Represents a 3D model composed of multiple meshes and materials.
TextureType
Enumerates supported texture map types for imported materials.