This class contains visual material properties. More...
#include <Material.hh>
Public Member Functions | |
Material () | |
Default constructor. | |
gz::math::Color | Ambient () const |
Get the ambient color. | |
gz::math::Color | Diffuse () const |
Get the diffuse color. | |
bool | DoubleSided () const |
Get whether double sided material is enabled. | |
sdf::ElementPtr | Element () const |
Get a pointer to the SDF element that was used during load. | |
gz::math::Color | Emissive () const |
Get the emissive color. | |
const std::string & | FilePath () const |
The path to the file where this element was loaded from. | |
bool | Lighting () const |
Get whether dynamic lighting is enabled. | |
Errors | Load (ElementPtr _sdf) |
Load the material based on a element pointer. | |
Errors | Load (sdf::ElementPtr _sdf, const ParserConfig &_config) |
Load the material based on a element pointer. | |
std::string | NormalMap () const |
Get the normal map filename. | |
const Pbr * | PbrMaterial () const |
Get the Physically Based Rendering (PBR) material. | |
float | RenderOrder () const |
Get render order for coplanar polygons. | |
std::string | ScriptName () const |
Get the name of the material script, or empty if one has not been specified. | |
std::string | ScriptUri () const |
Get the URI of the material script, if one has been set. | |
void | SetAmbient (const gz::math::Color &_color) |
Set the ambient color. | |
void | SetDiffuse (const gz::math::Color &_color) |
Set the diffuse color. | |
void | SetDoubleSided (bool _doubleSided) |
Set whether double sided material is enabled. | |
void | SetEmissive (const gz::math::Color &_color) |
Set the emissive color. | |
void | SetFilePath (const std::string &_filePath) |
Set the path to the file where this element was loaded from. | |
void | SetLighting (const bool _lighting) |
Set whether dynamic lighting is enabled. | |
void | SetNormalMap (const std::string &_map) |
Set the normal map filename. | |
void | SetPbrMaterial (const Pbr &_pbr) |
Set the Physically Based Rendering (PBR) material. | |
void | SetRenderOrder (const float _renderOrder) |
Set render order. | |
void | SetScriptName (const std::string &_name) |
Set the name of the material script. | |
void | SetScriptUri (const std::string &_uri) |
Set the URI of the material script. | |
void | SetShader (const ShaderType &_type) |
Set the type of shader. | |
void | SetShininess (const double _shininess) |
Set the specular exponent. | |
void | SetSpecular (const gz::math::Color &_color) |
Set the specular color. | |
ShaderType | Shader () const |
Get the type of shader. | |
double | Shininess () const |
Get the specular exponent. | |
gz::math::Color | Specular () const |
Get the specular color. | |
sdf::ElementPtr | ToElement () const |
Create and return an SDF element filled with data from this material. | |
sdf::ElementPtr | ToElement (sdf::Errors &_errors) const |
Create and return an SDF element filled with data from this material. | |
This class contains visual material properties.
sdf::SDF_VERSION_NAMESPACE::Material::Material | ( | ) |
Default constructor.
gz::math::Color sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::Material::DoubleSided | ( | ) | const |
Get whether double sided material is enabled.
The default value is false.
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Material::Element | ( | ) | const |
gz::math::Color sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::Material::FilePath | ( | ) | const |
The path to the file where this element was loaded from.
bool sdf::SDF_VERSION_NAMESPACE::Material::Lighting | ( | ) | const |
Get whether dynamic lighting is enabled.
The default value is true.
Errors sdf::SDF_VERSION_NAMESPACE::Material::Load | ( | ElementPtr | _sdf | ) |
Errors sdf::SDF_VERSION_NAMESPACE::Material::Load | ( | sdf::ElementPtr | _sdf, |
const ParserConfig & | _config | ||
) |
std::string sdf::SDF_VERSION_NAMESPACE::Material::NormalMap | ( | ) | const |
Get the normal map filename.
This will be an empty string if a normal map has not been set.
const Pbr * sdf::SDF_VERSION_NAMESPACE::Material::PbrMaterial | ( | ) | const |
Get the Physically Based Rendering (PBR) material.
float sdf::SDF_VERSION_NAMESPACE::Material::RenderOrder | ( | ) | const |
Get render order for coplanar polygons.
The higher value will be rendered on top of the other coplanar polygons. The default value is zero.
std::string sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::Material::ScriptUri | ( | ) | const |
Get the URI of the material script, if one has been set.
void sdf::SDF_VERSION_NAMESPACE::Material::SetAmbient | ( | const gz::math::Color & | _color | ) |
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::SDF_VERSION_NAMESPACE::Material::SetDiffuse | ( | const gz::math::Color & | _color | ) |
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::SDF_VERSION_NAMESPACE::Material::SetDoubleSided | ( | bool | _doubleSided | ) |
Set whether double sided material is enabled.
[in] | _lighting | False disables double sided material. |
void sdf::SDF_VERSION_NAMESPACE::Material::SetEmissive | ( | const gz::math::Color & | _color | ) |
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::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::Material::SetLighting | ( | const bool | _lighting | ) |
Set whether dynamic lighting is enabled.
[in] | _lighting | False disables dynamic lighting. |
void sdf::SDF_VERSION_NAMESPACE::Material::SetNormalMap | ( | const std::string & | _map | ) |
Set the normal map filename.
[in] | _map | Filename of the normal map. |
void sdf::SDF_VERSION_NAMESPACE::Material::SetPbrMaterial | ( | const Pbr & | _pbr | ) |
Set the Physically Based Rendering (PBR) material.
void sdf::SDF_VERSION_NAMESPACE::Material::SetRenderOrder | ( | const float | _renderOrder | ) |
void sdf::SDF_VERSION_NAMESPACE::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::SDF_VERSION_NAMESPACE::Material::SetScriptUri | ( | const std::string & | _uri | ) |
Set the URI of the material script.
[in] | _uri | The URI of the material script. |
void sdf::SDF_VERSION_NAMESPACE::Material::SetShader | ( | const ShaderType & | _type | ) |
Set the type of shader.
[in] | _type | Shader type. |
void sdf::SDF_VERSION_NAMESPACE::Material::SetShininess | ( | const double | _shininess | ) |
Set the specular exponent.
[in] | _shininess | Specular exponent. |
void sdf::SDF_VERSION_NAMESPACE::Material::SetSpecular | ( | const gz::math::Color & | _color | ) |
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::SDF_VERSION_NAMESPACE::Material::Shader | ( | ) | const |
Get the type of shader.
double sdf::SDF_VERSION_NAMESPACE::Material::Shininess | ( | ) | const |
Get the specular exponent.
gz::math::Color sdf::SDF_VERSION_NAMESPACE::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].
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Material::ToElement | ( | ) | const |
sdf::ElementPtr sdf::SDF_VERSION_NAMESPACE::Material::ToElement | ( | sdf::Errors & | _errors | ) | const |