Encapsulates description of a material. More...
#include <Material.hh>
Public Types | |
enum | BlendMode { ADD, MODULATE, REPLACE, BLEND_COUNT } |
enum | ShadeMode { FLAT, GOURAUD, PHONG, BLINN, SHADE_COUNT } |
Public Member Functions | |
Material () | |
Constructor. | |
Material (const Color &_clr) | |
Create a material with a default color. | |
virtual | ~Material () |
Destructor. | |
Color | GetAmbient () const |
Get the ambient color. | |
void | GetBlendFactors (double &_srcFactor, double &_dstFactor) |
Get the blend factors. | |
BlendMode | GetBlendMode () const |
Get the blending mode. | |
bool | GetDepthWrite () const |
Get depth write. | |
Color | GetDiffuse () const |
Get the diffuse color. | |
Color | GetEmissive () const |
Get the emissive color. | |
bool | GetLighting () const |
Get lighting enabled. | |
std::string | GetName () const |
Get the name of the material. | |
double | GetPointSize () const |
Get the point size. | |
ShadeMode | GetShadeMode () const |
Get the shading mode. | |
double | GetShininess () const |
Get the shininess. | |
Color | GetSpecular () const |
Get the specular color. | |
std::string | GetTextureImage () const |
Get a texture image. | |
double | GetTransparency () const |
Get the transparency percentage (0..1) | |
void | SetAmbient (const Color &_clr) |
Set the ambient color. | |
void | SetBlendFactors (double _srcFactor, double _dstFactor) |
Set the blende factors. | |
void | SetBlendMode (BlendMode _b) |
Set the blending mode. | |
void | SetDepthWrite (bool _value) |
Set depth write. | |
void | SetDiffuse (const Color &_clr) |
Set the diffuse color. | |
void | SetEmissive (const Color &_clr) |
Set the emissive color. | |
void | SetLighting (bool _value) |
Set lighting enabled. | |
void | SetPointSize (double _size) |
Set the point size. | |
void | SetShadeMode (ShadeMode _b) |
Set the shading mode param[in] the shading mode. | |
void | SetShininess (double _t) |
Set the shininess. | |
void | SetSpecular (const Color &_clr) |
Set the specular color. | |
void | SetTextureImage (const std::string &_tex) |
Set a texture image. | |
void | SetTextureImage (const std::string &_tex, const std::string &_resourcePath) |
Set a texture image. | |
void | SetTransparency (double _t) |
Set the transparency percentage (0..1) | |
Static Public Attributes | |
static std::string | BlendModeStr [BLEND_COUNT] |
static std::string | ShadeModeStr [SHADE_COUNT] |
Protected Attributes | |
Color | ambient |
the ambient light color | |
BlendMode | blendMode |
blend mode | |
Color | diffuse |
the diffuse ligth color | |
Color | emissive |
the emissive light color | |
std::string | name |
the name of the material | |
double | pointSize |
point size | |
ShadeMode | shadeMode |
the shade mode | |
double | shininess |
shininess value (0 to 1) | |
Color | specular |
the specular light color | |
std::string | texImage |
the texture image file name | |
double | transparency |
transparency value in the range 0 to 1 | |
Friends | |
std::ostream & | operator<< (std::ostream &_out, const gazebo::common::Material &_m) |
Stream insertion operator param[in] _out the output stream to extract from param[out] _m the material information. | |
Encapsulates description of a material.
gazebo::common::Material::Material | ( | ) |
Constructor.
|
virtual |
Destructor.
gazebo::common::Material::Material | ( | const Color & | _clr | ) |
Create a material with a default color.
[in] | _clr | Color of the material |
Color gazebo::common::Material::GetAmbient | ( | ) | const |
Get the ambient color.
void gazebo::common::Material::GetBlendFactors | ( | double & | _srcFactor, |
double & | _dstFactor | ||
) |
Get the blend factors.
[in] | _srcFactor | Source factor is returned in this variable |
[in] | _dstFactor | Destination factor is returned in this variable |
BlendMode gazebo::common::Material::GetBlendMode | ( | ) | const |
Get the blending mode.
bool gazebo::common::Material::GetDepthWrite | ( | ) | const |
Get depth write.
Color gazebo::common::Material::GetDiffuse | ( | ) | const |
Get the diffuse color.
Color gazebo::common::Material::GetEmissive | ( | ) | const |
Get the emissive color.
bool gazebo::common::Material::GetLighting | ( | ) | const |
Get lighting enabled.
std::string gazebo::common::Material::GetName | ( | ) | const |
Get the name of the material.
double gazebo::common::Material::GetPointSize | ( | ) | const |
Get the point size.
ShadeMode gazebo::common::Material::GetShadeMode | ( | ) | const |
Get the shading mode.
double gazebo::common::Material::GetShininess | ( | ) | const |
Get the shininess.
Color gazebo::common::Material::GetSpecular | ( | ) | const |
Get the specular color.
std::string gazebo::common::Material::GetTextureImage | ( | ) | const |
Get a texture image.
double gazebo::common::Material::GetTransparency | ( | ) | const |
Get the transparency percentage (0..1)
void gazebo::common::Material::SetAmbient | ( | const Color & | _clr | ) |
Set the ambient color.
[in] | _clr | The ambient color |
void gazebo::common::Material::SetBlendFactors | ( | double | _srcFactor, |
double | _dstFactor | ||
) |
Set the blende factors.
Will be interpreted as: (texture * _srcFactor) + (scene_pixel * _dstFactor)
[in] | _srcFactor | The source factor |
[in] | _dstFactor | The destination factor |
void gazebo::common::Material::SetBlendMode | ( | BlendMode | _b | ) |
Set the blending mode.
[in] | _b | the blend mode |
void gazebo::common::Material::SetDepthWrite | ( | bool | _value | ) |
Set depth write.
[in] | _value | the depth write enabled state |
void gazebo::common::Material::SetDiffuse | ( | const Color & | _clr | ) |
Set the diffuse color.
[in] | _clr | The diffuse color |
void gazebo::common::Material::SetEmissive | ( | const Color & | _clr | ) |
Set the emissive color.
[in] | _clr | The emissive color |
void gazebo::common::Material::SetLighting | ( | bool | _value | ) |
Set lighting enabled.
[in] | _value | the lighting enabled state |
void gazebo::common::Material::SetPointSize | ( | double | _size | ) |
Set the point size.
[in] | _size | the size |
void gazebo::common::Material::SetShadeMode | ( | ShadeMode | _b | ) |
Set the shading mode param[in] the shading mode.
void gazebo::common::Material::SetShininess | ( | double | _t | ) |
Set the shininess.
[in] | _t | The shininess value |
void gazebo::common::Material::SetSpecular | ( | const Color & | _clr | ) |
Set the specular color.
[in] | _clr | The specular color |
void gazebo::common::Material::SetTextureImage | ( | const std::string & | _tex | ) |
Set a texture image.
i] | _tex The name of the texture, which must be in Gazebo's resource path |
void gazebo::common::Material::SetTextureImage | ( | const std::string & | _tex, |
const std::string & | _resourcePath | ||
) |
Set a texture image.
i] | _tex The name of the texture |
_resourcePath] | _resourcePath Path which contains _tex |
void gazebo::common::Material::SetTransparency | ( | double | _t | ) |
Set the transparency percentage (0..1)
[in] | _t | The amount of transparency (0..1) |
|
friend |
Stream insertion operator param[in] _out the output stream to extract from param[out] _m the material information.
|
protected |
the ambient light color
|
protected |
blend mode
|
static |
|
protected |
the diffuse ligth color
|
protected |
the emissive light color
|
protected |
the name of the material
|
protected |
point size
|
protected |
the shade mode
|
static |
|
protected |
shininess value (0 to 1)
|
protected |
the specular light color
|
protected |
the texture image file name
|
protected |
transparency value in the range 0 to 1