17 #ifndef GAZEBO_COMMON_MATERIAL_HH_
18 #define GAZEBO_COMMON_MATERIAL_HH_
22 #include <ignition/math/Color.hh>
37 public:
enum ShadeMode {FLAT, GOURAUD, PHONG, BLINN, SHADE_COUNT};
38 public:
static std::string ShadeModeStr[SHADE_COUNT];
41 public:
static std::string BlendModeStr[BLEND_COUNT];
56 public:
explicit Material(
const ignition::math::Color &_clr);
60 public: std::string GetName()
const;
65 public:
void SetTextureImage(
const std::string &_tex);
70 public:
void SetTextureImage(
const std::string &_tex,
71 const std::string &_resourcePath);
76 public: std::string GetTextureImage()
const;
85 public:
void SetAmbient(
const ignition::math::Color &_clr);
94 public: ignition::math::
Color Ambient() const;
103 public:
void SetDiffuse(const ignition::math::
Color &_clr);
108 public:
Color GetDiffuse() const GAZEBO_DEPRECATED(9.0);
112 public: ignition::math::
Color Diffuse() const;
117 public:
void SetSpecular(const
Color &_clr) GAZEBO_DEPRECATED(9.0);
121 public:
void SetSpecular(const ignition::math::
Color &_clr);
126 public:
Color GetSpecular() const GAZEBO_DEPRECATED(9.0);
130 public: ignition::math::
Color Specular() const;
135 public:
void SetEmissive(const
Color &_clr) GAZEBO_DEPRECATED(9.0);
139 public:
void SetEmissive(const ignition::math::
Color &_clr);
144 public:
Color GetEmissive() const GAZEBO_DEPRECATED(9.0);
148 public: ignition::math::
Color Emissive() const;
152 public:
void SetTransparency(
double _t);
156 public:
double GetTransparency() const;
160 public:
void SetShininess(
double _t);
164 public:
double GetShininess() const;
170 public:
void SetBlendFactors(
double _srcFactor,
double _dstFactor);
175 public:
void GetBlendFactors(
double &_srcFactor,
double &_dstFactor)
196 public:
void SetPointSize(
double _size);
200 public:
double GetPointSize() const;
204 public:
void SetDepthWrite(
bool _value);
208 public:
bool GetDepthWrite() const;
212 public:
void SetLighting(
bool _value);
216 public:
bool GetLighting() const;
221 public: friend std::ostream &operator<<(std::ostream &_out,
224 _out <<
"Material:\n";
225 _out <<
" Name: " << _m.name <<
"\n";
226 _out <<
" Texture: " << _m.texImage <<
"\n";
227 _out <<
" Ambient: " << _m.ambient <<
"\n";
228 _out <<
" Diffuse: " << _m.diffuse <<
"\n";
229 _out <<
" Specular: " << _m.specular <<
"\n";
230 _out <<
" Emissive: " << _m.emissive <<
"\n";
231 _out <<
" Transparency: " << _m.transparency <<
"\n";
232 _out <<
" Shininess: " << _m.shininess <<
"\n";
233 _out <<
" BlendMode: " << BlendModeStr[_m.blendMode] <<
"\n";
234 _out <<
" ShadeMode: " << ShadeModeStr[_m.shadeMode] <<
"\n";
235 _out <<
" DepthWrite: " << _m.depthWrite <<
"\n";
258 protected:
double transparency = 0.0;
261 protected:
double shininess = 0.0;
273 private:
static unsigned int counter;
276 private:
bool depthWrite =
true;
278 private:
bool lighting =
true;
281 private:
double srcBlendFactor;
284 private:
double dstBlendFactor;
ShadeMode shadeMode
the shade mode
Definition: common/Material.hh:270
Encapsulates description of a material.
Definition: common/Material.hh:35
std::string texImage
the texture image file name
Definition: common/Material.hh:243
ignition::math::Color diffuse
the diffuse ligth color
Definition: common/Material.hh:249
Definition: common/Material.hh:40
ShadeMode
Definition: common/Material.hh:37
ignition::math::Color emissive
the emissive light color
Definition: common/Material.hh:255
std::string name
the name of the material
Definition: common/Material.hh:240
double pointSize
point size
Definition: common/Material.hh:264
Defines a color.
Definition: Color.hh:36
BlendMode
Definition: common/Material.hh:40
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:328
ignition::math::Color ambient
the ambient light color
Definition: common/Material.hh:246
ignition::math::Color specular
the specular light color
Definition: common/Material.hh:252
BlendMode blendMode
blend mode
Definition: common/Material.hh:267