This class contains visual material properties. More...
#include <Material.hh>
Public Member Functions | |
Material () | |
Default constructor. More... | |
Material (const Material &_material) | |
Copy constructor. More... | |
Material (Material &&_material) noexcept | |
Move constructor. More... | |
~Material () | |
Destructor. More... | |
gz::math::Color | Ambient () const |
Get the ambient color. More... | |
gz::math::Color | Diffuse () const |
Get the diffuse color. More... | |
bool | DoubleSided () const |
Get whether double sided material is enabled. More... | |
sdf::ElementPtr | Element () const |
Get a pointer to the SDF element that was used during load. More... | |
gz::math::Color | Emissive () const |
Get the emissive color. More... | |
const std::string & | FilePath () const |
The path to the file where this element was loaded from. More... | |
bool | Lighting () const |
Get whether dynamic lighting is enabled. More... | |
Errors | Load (ElementPtr _sdf) |
Load the material based on a element pointer. More... | |
std::string | NormalMap () const |
Get the normal map filename. More... | |
Material & | operator= (const Material &_material) |
Assignment operator. More... | |
Material & | operator= (Material &&_material) |
Move assignment operator. More... | |
Pbr * | PbrMaterial () const |
Get the Physically Based Rendering (PBR) material. More... | |
std::string | ScriptName () const |
Get the name of the material script, or empty if one has not been specified. More... | |
std::string | ScriptUri () const |
Get the URI of the material script, if one has been set. More... | |
void | SetAmbient (const gz::math::Color &_color) const |
Set the ambient color. More... | |
void | SetDiffuse (const gz::math::Color &_color) const |
Set the diffuse color. More... | |
void | SetDoubleSided (bool _doubleSided) |
Set whether double sided material is enabled. More... | |
void | SetEmissive (const gz::math::Color &_color) const |
Set the emissive color. More... | |
void | SetFilePath (const std::string &_filePath) |
Set the path to the file where this element was loaded from. More... | |
void | SetLighting (const bool _lighting) |
Set whether dynamic lighting is enabled. More... | |
void | SetNormalMap (const std::string &_map) |
Set the normal map filename. More... | |
void | SetPbrMaterial (const Pbr &_pbr) |
Set the Physically Based Rendering (PBR) material. More... | |
void | SetScriptName (const std::string &_name) |
Set the name of the material script. More... | |
void | SetScriptUri (const std::string &_uri) |
Set the URI of the material script. More... | |
void | SetShader (const ShaderType &_type) |
Set the type of shader. More... | |
void | SetShininess (const double _shininess) |
Set the specular exponent. More... | |
void | SetSpecular (const gz::math::Color &_color) const |
Set the specular color. More... | |
ShaderType | Shader () const |
Get the type of shader. More... | |
double | Shininess () const |
Get the specular exponent. More... | |
gz::math::Color | Specular () const |
Get the specular color. More... | |
This class contains visual material properties.
sdf::v9::Material::Material | ( | ) |
Default constructor.
sdf::v9::Material::Material | ( | const Material & | _material | ) |
Copy constructor.
[in] | _material | Material to copy. |
|
noexcept |
Move constructor.
[in] | _material | Material to move. |
sdf::v9::Material::~Material | ( | ) |
Destructor.
gz::math::Color sdf::v9::Material::Ambient | ( | ) | const |
Get the ambient color.
The ambient color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].
gz::math::Color sdf::v9::Material::Diffuse | ( | ) | const |
Get the diffuse color.
The diffuse color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].
bool sdf::v9::Material::DoubleSided | ( | ) | const |
Get whether double sided material is enabled.
The default value is false.
sdf::ElementPtr sdf::v9::Material::Element | ( | ) | const |
gz::math::Color sdf::v9::Material::Emissive | ( | ) | const |
Get the emissive color.
The emissive color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].
const std::string& sdf::v9::Material::FilePath | ( | ) | const |
The path to the file where this element was loaded from.
bool sdf::v9::Material::Lighting | ( | ) | const |
Get whether dynamic lighting is enabled.
The default value is true.
Errors sdf::v9::Material::Load | ( | ElementPtr | _sdf | ) |
std::string sdf::v9::Material::NormalMap | ( | ) | const |
Get the normal map filename.
This will be an empty string if a normal map has not been set.
Assignment operator.
[in] | _material | The material to set values from. |
Move assignment operator.
[in] | _material | The material to move from. |
Pbr* sdf::v9::Material::PbrMaterial | ( | ) | const |
Get the Physically Based Rendering (PBR) material.
std::string sdf::v9::Material::ScriptName | ( | ) | const |
Get the name of the material script, or empty if one has not been specified.
The name should match an script element in the script located at the ScriptUri().
std::string sdf::v9::Material::ScriptUri | ( | ) | const |
Get the URI of the material script, if one has been set.
void sdf::v9::Material::SetAmbient | ( | const gz::math::Color & | _color | ) | const |
Set the ambient color.
The ambient color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].
[in] | _color | Ambient color. |
void sdf::v9::Material::SetDiffuse | ( | const gz::math::Color & | _color | ) | const |
Set the diffuse color.
The diffuse color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].
[in] | _color | Diffuse color. |
void sdf::v9::Material::SetDoubleSided | ( | bool | _doubleSided | ) |
Set whether double sided material is enabled.
[in] | _lighting | False disables double sided material. |
void sdf::v9::Material::SetEmissive | ( | const gz::math::Color & | _color | ) | const |
Set the emissive color.
The emissive color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].
[in] | _color | Emissive color. |
void sdf::v9::Material::SetFilePath | ( | const std::string & | _filePath | ) |
Set the path to the file where this element was loaded from.
\paramp[in] _filePath Full path to the file on disk.
void sdf::v9::Material::SetLighting | ( | const bool | _lighting | ) |
Set whether dynamic lighting is enabled.
[in] | _lighting | False disables dynamic lighting. |
void sdf::v9::Material::SetNormalMap | ( | const std::string & | _map | ) |
Set the normal map filename.
[in] | _map | Filename of the normal map. |
void sdf::v9::Material::SetPbrMaterial | ( | const Pbr & | _pbr | ) |
Set the Physically Based Rendering (PBR) material.
void sdf::v9::Material::SetScriptName | ( | const std::string & | _name | ) |
Set the name of the material script.
The name should match an script element in the script located at the ScriptUri().
[in] | _name | The name of the material script. |
void sdf::v9::Material::SetScriptUri | ( | const std::string & | _uri | ) |
Set the URI of the material script.
[in] | _uri | The URI of the material script. |
void sdf::v9::Material::SetShader | ( | const ShaderType & | _type | ) |
Set the type of shader.
[in] | _type | Shader type. |
void sdf::v9::Material::SetShininess | ( | const double | _shininess | ) |
Set the specular exponent.
[in] | _shininess | Specular exponent. |
void sdf::v9::Material::SetSpecular | ( | const gz::math::Color & | _color | ) | const |
Set the specular color.
The specular color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].
[in] | _color | Specular color. |
ShaderType sdf::v9::Material::Shader | ( | ) | const |
Get the type of shader.
double sdf::v9::Material::Shininess | ( | ) | const |
Get the specular exponent.
gz::math::Color sdf::v9::Material::Specular | ( | ) | const |
Get the specular color.
The specular color is specified by a set of three numbers representing red/green/blue, each in the range of [0,1].