|
Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
|
#include <Material.hpp>
Classes | |
| struct | MaterialData |
Public Member Functions | |
| Material ()=default | |
| Material (const aiScene *scene, uint32_t materialIndex, eastl::string modelName) | |
| Creates a new material from the material data stored in the scene at the given index. Doesn't load any data if the index is larger than the amount of materials contained in. Use this function in the mesh loading code to create the meshes with the default materials for that mesh. More... | |
| virtual | ~Material () |
| virtual void | SetDiffuseTexture (eastl::string diffuseTextureName) |
| Changes the diffuse texture of the material. NOTE: Texture will be loaded in, if it doesn't excist yet. More... | |
| virtual void | SetDiffuseTexture (eastl::shared_ptr< Texture > diffuseTexture) |
| Changes the diffuse texture of the material. Pass a nullptr to clear the current texture. More... | |
| eastl::weak_ptr< Texture > | GetDiffuseTexture () |
| Returns the diffuse texture of the material. Returns nullptr if the current material doesn't have a diffuse texture. More... | |
| eastl::weak_ptr< Texture > | GetDefaultDiffuseTexture () |
| Returns the diffuse texture that was defined by the model this material was created from. Returns nullptr if no diffuse texture was specified for the material. More... | |
| bool | IsDiffuseLoaded () const |
| Indicates if the material has a diffuse texture loaded or not. More... | |
| virtual void | SetBumpMapTexture (eastl::string bumpMapTextureName) |
| Changes the bump map texture of the material. NOTE: Texture will be loaded in, if it doesn't excist yet. More... | |
| virtual void | SetBumpMapTexture (eastl::shared_ptr< Texture > bumpMapTexture) |
| Changes the bump map texture of the material. Pass a nullptr to clear the current texture. More... | |
| eastl::weak_ptr< Texture > | GetBumpMapTexture () const |
| Returns the bump map texture of the material. Returns nullptr if the current material doesn't have a bump map texture. More... | |
| eastl::weak_ptr< Texture > | GetDefaultBumpMapTexture () const |
| Returns the bump map texture that was defined by the model this material was created from. Returns nullptr if no bump map texture was specified for the material. More... | |
| bool | IsBumpMapLoaded () const |
| Indicates if the material has a bump map texture loaded or not. More... | |
| virtual void | SetSpecularTexture (eastl::shared_ptr< Texture > specularTexture) |
| Changes the specular texture of the material. Pass a nullptr to clear the current texture. More... | |
| eastl::weak_ptr< Texture > | GetSpecularTexture () const |
| Returns the specular texture of the material. Returns nullptr if the current material doesn't have a specular texture. More... | |
| eastl::weak_ptr< Texture > | GetDefaultSpecularTexture () const |
| Returns the specular texture that was defined by the model this material was created from. Returns nullptr if no specular texture was specified for the material. More... | |
| bool | IsSpecularLoaded () const |
| Indicates if the material has a specular texture loaded or not. More... | |
| virtual void | SetDiffuseColor (glm::vec3 diffuseColor) |
| Sets the material's diffuse color. More... | |
| glm::vec3 | GetDiffuseColor () const |
| Returns the material's diffuse color. More... | |
| glm::vec3 | GetDefaultDiffuseColor () const |
| Returns the diffuse color that was defined by the model this material was created from. More... | |
| virtual void | SetSpecularColor (glm::vec3 specularColor) |
| Sets the material's specular color. More... | |
| glm::vec3 | GetSpecularColor () const |
| Returns the material's specular color. More... | |
| glm::vec3 | GetDefaultSpecularColor () const |
| Returns the specular color that was defined by the model this material was created from. More... | |
| void | SetSpecularScale (float scale) |
| Sets the scale of the specular highlights (strength) of the material. More... | |
| float | GetSpecularScale () const |
| Returns the scale of the specular highlights (strength). More... | |
| float | GetDefaultSpecularScale () const |
| Returns the scale of the specular highlights (strength) that was defined by the model this material was created from. More... | |
| void | SetSpecularExponent (float exponent) |
| Sets the specular exponent of the material (shinyness). More... | |
| float | GetSpecularExponent () const |
| Returns the specular exponent of the material. More... | |
| float | GetDefaultSpecularExponent () const |
| Returns the specular exponent of the material that was defined by the model this material was created from. More... | |
| bool | operator== (const Material &other) const |
| Returns whether or not two materials are the same. More... | |
Protected Types | |
| typedef struct Engine::Material::MaterialData | MaterialData_t |
Protected Member Functions | |
| virtual void | UpdateMaterialData () |
| eastl::weak_ptr< Texture > | LoadTexture (const aiScene *scene, aiMaterial *material, aiTextureType textureType) |
Protected Attributes | |
| MaterialData_t | materialData_ |
| MaterialData_t | defaultMaterialData_ |
| eastl::string | modelName |
| eastl::weak_ptr< Texture > | diffuseTexture |
| eastl::weak_ptr< Texture > | defaultDiffuseTexture |
| eastl::weak_ptr< Texture > | bumpMapTexture |
| eastl::weak_ptr< Texture > | defaultBumpMapTexture |
| eastl::weak_ptr< Texture > | specularTexture |
| eastl::weak_ptr< Texture > | defaultSpecularTexture |
| eastl::weak_ptr< Texture > | missingTexture |
Definition at line 19 of file Material.hpp.
|
protected |
|
default |
| Engine::Material::Material | ( | const aiScene * | scene, |
| uint32_t | materialIndex, | ||
| eastl::string | modelName | ||
| ) |
Creates a new material from the material data stored in the scene at the given index. Doesn't load any data if the index is larger than the amount of materials contained in. Use this function in the mesh loading code to create the meshes with the default materials for that mesh.
| scene | The scene (model) to load the material from. |
| materialIndex | The specific material from the material array to load. |
| modelName | The name of the model. This is used for naming any embedded textures found in the file. |
Definition at line 9 of file Material.cpp.
|
virtual |
Definition at line 79 of file Material.cpp.
| eastl::weak_ptr< Texture > Engine::Material::GetBumpMapTexture | ( | ) | const |
Returns the bump map texture of the material. Returns nullptr if the current material doesn't have a bump map texture.
Definition at line 164 of file Material.cpp.
| eastl::weak_ptr< Texture > Engine::Material::GetDefaultBumpMapTexture | ( | ) | const |
Returns the bump map texture that was defined by the model this material was created from. Returns nullptr if no bump map texture was specified for the material.
Definition at line 172 of file Material.cpp.
| glm::vec3 Engine::Material::GetDefaultDiffuseColor | ( | ) | const |
Returns the diffuse color that was defined by the model this material was created from.
Definition at line 226 of file Material.cpp.
| eastl::weak_ptr< Texture > Engine::Material::GetDefaultDiffuseTexture | ( | ) |
Returns the diffuse texture that was defined by the model this material was created from. Returns nullptr if no diffuse texture was specified for the material.
Definition at line 121 of file Material.cpp.
| glm::vec3 Engine::Material::GetDefaultSpecularColor | ( | ) | const |
Returns the specular color that was defined by the model this material was created from.
Definition at line 242 of file Material.cpp.
| float Engine::Material::GetDefaultSpecularExponent | ( | ) | const |
Returns the specular exponent of the material that was defined by the model this material was created from.
Definition at line 274 of file Material.cpp.
| float Engine::Material::GetDefaultSpecularScale | ( | ) | const |
Returns the scale of the specular highlights (strength) that was defined by the model this material was created from.
Definition at line 258 of file Material.cpp.
| eastl::weak_ptr< Texture > Engine::Material::GetDefaultSpecularTexture | ( | ) | const |
Returns the specular texture that was defined by the model this material was created from. Returns nullptr if no specular texture was specified for the material.
Definition at line 205 of file Material.cpp.
| glm::vec3 Engine::Material::GetDiffuseColor | ( | ) | const |
Returns the material's diffuse color.
Definition at line 221 of file Material.cpp.
| eastl::weak_ptr< Texture > Engine::Material::GetDiffuseTexture | ( | ) |
Returns the diffuse texture of the material. Returns nullptr if the current material doesn't have a diffuse texture.
Definition at line 113 of file Material.cpp.
| glm::vec3 Engine::Material::GetSpecularColor | ( | ) | const |
Returns the material's specular color.
Definition at line 237 of file Material.cpp.
| float Engine::Material::GetSpecularExponent | ( | ) | const |
Returns the specular exponent of the material.
Definition at line 269 of file Material.cpp.
| float Engine::Material::GetSpecularScale | ( | ) | const |
Returns the scale of the specular highlights (strength).
Definition at line 253 of file Material.cpp.
| eastl::weak_ptr< Texture > Engine::Material::GetSpecularTexture | ( | ) | const |
Returns the specular texture of the material. Returns nullptr if the current material doesn't have a specular texture.
Definition at line 200 of file Material.cpp.
| bool Engine::Material::IsBumpMapLoaded | ( | ) | const |
Indicates if the material has a bump map texture loaded or not.
Definition at line 180 of file Material.cpp.
| bool Engine::Material::IsDiffuseLoaded | ( | ) | const |
Indicates if the material has a diffuse texture loaded or not.
Definition at line 129 of file Material.cpp.
| bool Engine::Material::IsSpecularLoaded | ( | ) | const |
Indicates if the material has a specular texture loaded or not.
Definition at line 210 of file Material.cpp.
|
protected |
Definition at line 297 of file Material.cpp.
| bool Engine::Material::operator== | ( | const Material & | other | ) | const |
Returns whether or not two materials are the same.
| other | The material to compare to. |
Definition at line 279 of file Material.cpp.
|
virtual |
Changes the bump map texture of the material. NOTE: Texture will be loaded in, if it doesn't excist yet.
| bumpMapTextureName | The texture you want to create. NOTE: The texture needs to be located under 'Resources/Textures/'. You then give the texture name + extension. The texture can be in a subfolder of of 'Resources/Textures/'. |
Definition at line 134 of file Material.cpp.
|
virtual |
Changes the bump map texture of the material. Pass a nullptr to clear the current texture.
| bumpMapTexture | The new bump map texture. |
Definition at line 149 of file Material.cpp.
|
virtual |
Sets the material's diffuse color.
| diffuseColor | The new color. |
Definition at line 215 of file Material.cpp.
|
virtual |
Changes the diffuse texture of the material. NOTE: Texture will be loaded in, if it doesn't excist yet.
| diffuseTextureName | The texture you want to create. NOTE: The texture needs to be located under 'Resources/Textures/'. You then give the texture name + extension. The texture can be in a subfolder of of 'Resources/Textures/'. |
Definition at line 83 of file Material.cpp.
|
virtual |
Changes the diffuse texture of the material. Pass a nullptr to clear the current texture.
| diffuseTexture | The new diffuse texture. |
Definition at line 98 of file Material.cpp.
|
virtual |
Sets the material's specular color.
| specularColor | The new color. |
Definition at line 231 of file Material.cpp.
| void Engine::Material::SetSpecularExponent | ( | float | exponent | ) |
Sets the specular exponent of the material (shinyness).
| exponent | The new exponent. |
Definition at line 263 of file Material.cpp.
| void Engine::Material::SetSpecularScale | ( | float | scale | ) |
Sets the scale of the specular highlights (strength) of the material.
| scale | The new scale. |
Definition at line 247 of file Material.cpp.
|
virtual |
Changes the specular texture of the material. Pass a nullptr to clear the current texture.
| specularTexture | The new specular texture. |
Definition at line 185 of file Material.cpp.
|
protectedvirtual |
Definition at line 293 of file Material.cpp.
|
protected |
Definition at line 230 of file Material.hpp.
|
protected |
Definition at line 231 of file Material.hpp.
|
protected |
Definition at line 229 of file Material.hpp.
|
protected |
Definition at line 224 of file Material.hpp.
|
protected |
Definition at line 233 of file Material.hpp.
|
protected |
Definition at line 228 of file Material.hpp.
|
protected |
Definition at line 223 of file Material.hpp.
|
protected |
Definition at line 235 of file Material.hpp.
|
protected |
Definition at line 226 of file Material.hpp.
|
protected |
Definition at line 232 of file Material.hpp.
1.8.11