Public Member Functions | List of all members
sdf::v11::Material Class Reference

This class contains visual material properties. More...

#include <Material.hh>

Public Member Functions

 Material ()
 Default constructor. More...
 
ignition::math::Color Ambient () const
 Get the ambient color. More...
 
ignition::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...
 
ignition::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...
 
const PbrPbrMaterial () const
 Get the Physically Based Rendering (PBR) material. More...
 
float RenderOrder () const
 Get render order. 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 ignition::math::Color &_color)
 Set the ambient color. More...
 
void SetDiffuse (const ignition::math::Color &_color)
 Set the diffuse color. More...
 
void SetDoubleSided (bool _doubleSided)
 Set whether double sided material is enabled. More...
 
void SetEmissive (const ignition::math::Color &_color)
 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 SetRenderOrder (const float _renderOrder)
 Set render order. 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 SetSpecular (const ignition::math::Color &_color)
 Set the specular color. More...
 
ShaderType Shader () const
 Get the type of shader. More...
 
ignition::math::Color Specular () const
 Get the specular color. More...
 

Detailed Description

This class contains visual material properties.

Constructor & Destructor Documentation

◆ Material()

sdf::v11::Material::Material ( )

Default constructor.

Member Function Documentation

◆ Ambient()

ignition::math::Color sdf::v11::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].

Returns
Ambient color.

◆ Diffuse()

ignition::math::Color sdf::v11::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].

Returns
Diffuse color.

◆ DoubleSided()

bool sdf::v11::Material::DoubleSided ( ) const

Get whether double sided material is enabled.

The default value is false.

Returns
False if double sided material should be disabled.

◆ Element()

sdf::ElementPtr sdf::v11::Material::Element ( ) const

Get a pointer to the SDF element that was used during load.

Returns
SDF element pointer. The value will be nullptr if Load has not been called.

◆ Emissive()

ignition::math::Color sdf::v11::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].

Returns
Emissive color.

◆ FilePath()

const std::string& sdf::v11::Material::FilePath ( ) const

The path to the file where this element was loaded from.

Returns
Full path to the file on disk.

◆ Lighting()

bool sdf::v11::Material::Lighting ( ) const

Get whether dynamic lighting is enabled.

The default value is true.

Returns
False if dynamic lighting should be disabled.

◆ Load()

Errors sdf::v11::Material::Load ( ElementPtr  _sdf)

Load the material based on a element pointer.

This is not the usual entry point. Typical usage of the SDF DOM is through the Root object.

Parameters
[in]_sdfThe SDF Element pointer
Returns
Errors, which is a vector of Error objects. Each Error includes an error code and message. An empty vector indicates no error.

◆ NormalMap()

std::string sdf::v11::Material::NormalMap ( ) const

Get the normal map filename.

This will be an empty string if a normal map has not been set.

Returns
Filename of the normal map, or empty string if a normal map has not been specified.

◆ PbrMaterial()

const Pbr* sdf::v11::Material::PbrMaterial ( ) const

Get the Physically Based Rendering (PBR) material.

Returns
Pointer to the PBR material. Null if it does not exist.

◆ RenderOrder()

float sdf::v11::Material::RenderOrder ( ) const

Get render order.

Returns
Render order

◆ ScriptName()

std::string sdf::v11::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().

Returns
The name of the material script, or empty string if one has not been set.

◆ ScriptUri()

std::string sdf::v11::Material::ScriptUri ( ) const

Get the URI of the material script, if one has been set.

Returns
The URI of the material script, or empty string if one has not been set.

◆ SetAmbient()

void sdf::v11::Material::SetAmbient ( const ignition::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].

Parameters
[in]_colorAmbient color.

◆ SetDiffuse()

void sdf::v11::Material::SetDiffuse ( const ignition::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].

Parameters
[in]_colorDiffuse color.

◆ SetDoubleSided()

void sdf::v11::Material::SetDoubleSided ( bool  _doubleSided)

Set whether double sided material is enabled.

Parameters
[in]_lightingFalse disables double sided material.

◆ SetEmissive()

void sdf::v11::Material::SetEmissive ( const ignition::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].

Parameters
[in]_colorEmissive color.

◆ SetFilePath()

void sdf::v11::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.

◆ SetLighting()

void sdf::v11::Material::SetLighting ( const bool  _lighting)

Set whether dynamic lighting is enabled.

Parameters
[in]_lightingFalse disables dynamic lighting.

◆ SetNormalMap()

void sdf::v11::Material::SetNormalMap ( const std::string &  _map)

Set the normal map filename.

Parameters
[in]_mapFilename of the normal map.

◆ SetPbrMaterial()

void sdf::v11::Material::SetPbrMaterial ( const Pbr _pbr)

Set the Physically Based Rendering (PBR) material.

Returns
The PBR material to set to.

◆ SetRenderOrder()

void sdf::v11::Material::SetRenderOrder ( const float  _renderOrder)

Set render order.

Parameters
[in]_renderOrderrender order

◆ SetScriptName()

void sdf::v11::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().

Parameters
[in]_nameThe name of the material script.

◆ SetScriptUri()

void sdf::v11::Material::SetScriptUri ( const std::string &  _uri)

Set the URI of the material script.

Parameters
[in]_uriThe URI of the material script.

◆ SetShader()

void sdf::v11::Material::SetShader ( const ShaderType _type)

Set the type of shader.

Parameters
[in]_typeShader type.

◆ SetSpecular()

void sdf::v11::Material::SetSpecular ( const ignition::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].

Parameters
[in]_colorSpecular color.

◆ Shader()

ShaderType sdf::v11::Material::Shader ( ) const

Get the type of shader.

Returns
Shader type.

◆ Specular()

ignition::math::Color sdf::v11::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].

Returns
Specular color.

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