Ignition Rendering

API Reference

0.1.0
OgreMaterial.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 #ifndef IGNITION_RENDERING_OGRE_OGREMATERIAL_HH_
18 #define IGNITION_RENDERING_OGRE_OGREMATERIAL_HH_
19 
20 #include <string>
21 
25 
26 namespace ignition
27 {
28  namespace rendering
29  {
30  class IGNITION_RENDERING_OGRE_VISIBLE OgreMaterial :
31  public BaseMaterial<OgreObject>
32  {
33  protected: OgreMaterial();
34 
35  public: virtual ~OgreMaterial();
36 
37  public: virtual bool LightingEnabled() const;
38 
39  public: virtual void SetLightingEnabled(const bool _enabled);
40 
41  public: virtual math::Color Ambient() const;
42 
43  public: virtual void SetAmbient(const math::Color &_color);
44 
45  public: virtual math::Color Diffuse() const;
46 
47  public: virtual void SetDiffuse(const math::Color &_color);
48 
49  public: virtual math::Color Specular() const;
50 
51  public: virtual void SetSpecular(const math::Color &_color);
52 
53  public: virtual math::Color Emissive() const;
54 
55  public: virtual void SetEmissive(const math::Color &_color);
56 
57  public: virtual double Shininess() const;
58 
59  public: virtual void SetShininess(const double _shininess);
60 
61  public: virtual double Transparency() const;
62 
63  public: virtual void SetTransparency(const double _transparency);
64 
65  public: virtual double Reflectivity() const;
66 
67  public: virtual void SetReflectivity(const double _reflectivity);
68 
69  public: virtual bool CastShadows() const;
70 
71  public: virtual void SetCastShadows(const bool _castShadows);
72 
73  public: virtual bool ReceiveShadows() const;
74 
75  public: virtual void SetReceiveShadows(const bool _receiveShadows);
76 
77  public: virtual bool ReflectionEnabled() const;
78 
79  public: virtual void SetReflectionEnabled(const bool _enabled);
80 
81  public: virtual bool HasTexture() const;
82 
83  public: virtual std::string Texture() const;
84 
85  public: virtual void SetTexture(const std::string &_name);
86 
87  public: virtual void ClearTexture();
88 
89  public: virtual bool HasNormalMap() const;
90 
91  public: virtual std::string NormalMap() const;
92 
93  public: virtual void SetNormalMap(const std::string &_name);
94 
95  public: virtual void ClearNormalMap();
96 
97  public: virtual enum ShaderType ShaderType() const;
98 
99  public: virtual void SetShaderType(enum ShaderType _type);
100 
101  public: virtual Ogre::MaterialPtr Material() const;
102 
103  protected: virtual void LoadImage(const std::string &_name,
104  Ogre::Image &_image);
105 
108  protected: virtual void SetTextureImpl(const std::string &_texture);
109 
110  protected: virtual Ogre::TexturePtr Texture(const std::string &_name);
111 
112  protected: virtual Ogre::TexturePtr CreateTexture(
113  const std::string &_name);
114 
115  protected: virtual void UpdateTransparency();
116 
117  protected: virtual void UpdateColorOperation();
118 
119  protected: virtual void Init();
120 
122 
123  protected: Ogre::Technique *ogreTechnique = nullptr;
124 
125  protected: Ogre::Pass *ogrePass = nullptr;
126 
127  protected: Ogre::TextureUnitState *ogreTexState = nullptr;
128 
130 
131 #if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR <= 7
132  protected: math::Color emissiveColor;
133 #endif
134  protected: double shininess = 0.0;
135 
136  protected: double transparency = 0.0;
137 
138  protected: double reflectivity = 0.0;
139 
140  protected: bool castShadows = true;
141 
142  protected: bool reflectionEnabled = true;
143 
145 
147 
148  protected: enum ShaderType shaderType = ST_PIXEL;
149 
150  private: friend class OgreScene;
151  };
152  }
153 }
154 #endif
STL class.
Ogre::String ogreGroup
Definition: OgreMaterial.hh:129
std::string normalMapName
Definition: OgreMaterial.hh:146
Definition: OgreMaterial.hh:30
Definition: OgreScene.hh:34
std::string textureName
Definition: OgreMaterial.hh:144
ShaderType
Available types of shaders. Note that not all rendering-engines will be able to use each type...
Definition: ShaderType.hh:31
Definition: BaseMaterial.hh:30
Shader shader.
Definition: ShaderType.hh:37
Ogre::MaterialPtr ogreMaterial
Definition: OgreMaterial.hh:121
Definition: ArrowVisual.hh:22
Represents a surface material of a Geometry.
Definition: Material.hh:34