17 #ifndef GAZEBO_COMMON_MATERIAL_HH_ 18 #define GAZEBO_COMMON_MATERIAL_HH_ 22 #include <ignition/math/Color.hh> 36 public:
enum ShadeMode {FLAT, GOURAUD, PHONG, BLINN, SHADE_COUNT};
37 public:
static std::string ShadeModeStr[SHADE_COUNT];
40 public:
static std::string BlendModeStr[BLEND_COUNT];
50 public:
explicit Material(
const ignition::math::Color &_clr);
54 public: std::string GetName()
const;
59 public:
void SetTextureImage(
const std::string &_tex);
64 public:
void SetTextureImage(
const std::string &_tex,
65 const std::string &_resourcePath);
70 public: std::string GetTextureImage()
const;
74 public:
void SetAmbient(
const ignition::math::Color &_clr);
78 public: ignition::math::Color Ambient()
const;
82 public:
void SetDiffuse(
const ignition::math::Color &_clr);
86 public: ignition::math::Color Diffuse()
const;
90 public:
void SetSpecular(
const ignition::math::Color &_clr);
94 public: ignition::math::Color Specular()
const;
98 public:
void SetEmissive(
const ignition::math::Color &_clr);
102 public: ignition::math::Color Emissive()
const;
106 public:
void SetTransparency(
double _t);
110 public:
double GetTransparency()
const;
114 public:
void SetShininess(
double _t);
118 public:
double GetShininess()
const;
124 public:
void SetBlendFactors(
double _srcFactor,
double _dstFactor);
129 public:
void GetBlendFactors(
double &_srcFactor,
double &_dstFactor)
150 public:
void SetPointSize(
double _size);
154 public:
double GetPointSize()
const;
158 public:
void SetDepthWrite(
bool _value);
162 public:
bool GetDepthWrite()
const;
166 public:
void SetLighting(
bool _value);
170 public:
bool GetLighting()
const;
178 _out <<
"Material:\n";
179 _out <<
" Name: " << _m.
name <<
"\n";
180 _out <<
" Texture: " << _m.
texImage <<
"\n";
181 _out <<
" Ambient: " << _m.
ambient <<
"\n";
182 _out <<
" Diffuse: " << _m.
diffuse <<
"\n";
183 _out <<
" Specular: " << _m.
specular <<
"\n";
184 _out <<
" Emissive: " << _m.
emissive <<
"\n";
186 _out <<
" Shininess: " << _m.
shininess <<
"\n";
187 _out <<
" BlendMode: " << BlendModeStr[_m.
blendMode] <<
"\n";
188 _out <<
" ShadeMode: " << ShadeModeStr[_m.
shadeMode] <<
"\n";
189 _out <<
" DepthWrite: " << _m.depthWrite <<
"\n";
212 protected:
double transparency = 0.0;
215 protected:
double shininess = 0.0;
227 private:
static unsigned int counter;
230 private:
bool depthWrite =
true;
232 private:
bool lighting =
true;
235 private:
double srcBlendFactor;
238 private:
double dstBlendFactor;
ShadeMode shadeMode
the shade mode
Definition: common/Material.hh:224
Encapsulates description of a material.
Definition: common/Material.hh:34
Forward declarations for the common classes.
Definition: Animation.hh:26
std::string texImage
the texture image file name
Definition: common/Material.hh:197
ignition::math::Color diffuse
the diffuse ligth color
Definition: common/Material.hh:203
Definition: common/Material.hh:39
ShadeMode
Definition: common/Material.hh:36
ignition::math::Color emissive
the emissive light color
Definition: common/Material.hh:209
std::string name
the name of the material
Definition: common/Material.hh:194
double pointSize
point size
Definition: common/Material.hh:218
double shininess
shininess value (0 to 1)
Definition: common/Material.hh:215
BlendMode
Definition: common/Material.hh:39
ignition::math::Color ambient
the ambient light color
Definition: common/Material.hh:200
ignition::math::Color specular
the specular light color
Definition: common/Material.hh:206
BlendMode blendMode
blend mode
Definition: common/Material.hh:221
friend 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...
Definition: common/Material.hh:175
double transparency
transparency value in the range 0 to 1
Definition: common/Material.hh:212