Gazebo Rendering

API Reference

3.7.2
gz/rendering/ogre2/Ogre2Light.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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 GZ_RENDERING_OGRE2_OGRE2LIGHT_HH_
18 #define GZ_RENDERING_OGRE2_OGRE2LIGHT_HH_
19 
23 
24 namespace Ogre
25 {
26  class Light;
27 }
28 
29 namespace ignition
30 {
31  namespace rendering
32  {
33  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
34  //
36  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2Light :
37  public BaseLight<Ogre2Node>
38  {
40  protected: Ogre2Light();
41 
43  public: virtual ~Ogre2Light();
44 
45  // Documentation Inherited
46  public: virtual math::Color DiffuseColor() const override;
47 
48  // Documentation Inherited
49  public: virtual void SetDiffuseColor(const math::Color &_color) override;
50 
51  // Documentation Inherited
52  public: virtual math::Color SpecularColor() const override;
53 
54  // Documentation Inherited
55  public: virtual void SetSpecularColor(const math::Color &_color) override;
56 
57  // Documentation Inherited
58  public: virtual double AttenuationConstant() const override;
59 
60  // Documentation Inherited
61  public: virtual void SetAttenuationConstant(double _value) override;
62 
63  // Documentation Inherited
64  public: virtual double AttenuationLinear() const override;
65 
66  // Documentation Inherited
67  public: virtual void SetAttenuationLinear(double _value) override;
68 
69  // Documentation Inherited
70  public: virtual double AttenuationQuadratic() const override;
71 
72  // Documentation Inherited
73  public: virtual void SetAttenuationQuadratic(double _value) override;
74 
75  // Documentation Inherited
76  public: virtual double AttenuationRange() const override;
77 
78  // Documentation Inherited
79  public: virtual void SetAttenuationRange(double _range) override;
80 
81  // Documentation Inherited
82  public: virtual bool CastShadows() const override;
83 
84  // Documentation Inherited
85  public: virtual void SetCastShadows(bool _castShadows) override;
86 
88  public: virtual Ogre::Light *Light() const;
89 
91  public: virtual void Destroy() override;
92 
94  protected: virtual void Init() override;
95 
97  private: void CreateLight();
98 
100  private: void UpdateAttenuation();
101 
103  protected: double attenConstant = 1.0;
104 
106  protected: double attenLinear = 0.0;
107 
109  protected: double attenQuadratic = 0.0;
110 
112  protected: double attenRange = 100.0;
113 
115  protected: Ogre::Light *ogreLight = nullptr;
116 
118  protected: Ogre::Light::LightTypes ogreLightType;
119  };
120 
122  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2DirectionalLight :
123  public BaseDirectionalLight<Ogre2Light>
124  {
126  protected: Ogre2DirectionalLight();
127 
129  public: virtual ~Ogre2DirectionalLight();
130 
131  // Documentation Inherited
132  public: virtual math::Vector3d Direction() const override;
133 
134  // Documentation Inherited
135  public: virtual void SetDirection(const math::Vector3d &_dir) override;
136 
138  private: friend class Ogre2Scene;
139  };
140 
142  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2PointLight :
143  public BasePointLight<Ogre2Light>
144  {
146  protected: Ogre2PointLight();
147 
149  public: virtual ~Ogre2PointLight();
150 
152  private: friend class Ogre2Scene;
153  };
154 
156  class IGNITION_RENDERING_OGRE2_VISIBLE Ogre2SpotLight :
157  public BaseSpotLight<Ogre2Light>
158  {
160  protected: Ogre2SpotLight();
161 
163  public: virtual ~Ogre2SpotLight();
164 
165  // Documentation inherited.
166  public: virtual math::Vector3d Direction() const override;
167 
168  // Documentation Inherited
169  public: virtual void SetDirection(const math::Vector3d &_dir) override;
170 
171  // Documentation Inherited
172  public: virtual math::Angle InnerAngle() const override;
173 
174  // Documentation Inherited
175  public: virtual void SetInnerAngle(const math::Angle &_angle) override;
176 
177  // Documentation Inherited
178  public: virtual math::Angle OuterAngle() const override;
179 
180  // Documentation Inherited
181  public: virtual void SetOuterAngle(const math::Angle &_angle) override;
182 
183  // Documentation Inherited
184  public: virtual double Falloff() const override;
185 
186  // Documentation Inherited
187  public: virtual void SetFalloff(double _falloff) override;
188 
190  private: friend class Ogre2Scene;
191  };
192  }
193  }
194 }
195 #endif
Ogre 2.x implementation of the light class.
Definition: gz/rendering/ogre2/Ogre2Light.hh:36
Definition: gz/rendering/base/BaseLight.hh:97
Definition: gz/rendering/ogre/OgreCamera.hh:27
Definition: gz/rendering/base/BaseLight.hh:71
Definition: gz/rendering/base/BaseLight.hh:87
Ogre 2.x implementation of the spot light class.
Definition: gz/rendering/ogre2/Ogre2Light.hh:156
Ogre 2.x implementation of the point light class.
Definition: gz/rendering/ogre2/Ogre2Light.hh:142
Definition: gz/rendering/base/BaseLight.hh:29
Ogre2.x implementation of the scene class.
Definition: gz/rendering/ogre2/Ogre2Scene.hh:41
Ogre 2.x implementation of the directional light class.
Definition: gz/rendering/ogre2/Ogre2Light.hh:122
Represents a light source in the scene graph.
Definition: gz/rendering/Light.hh:32
Ogre::Light::LightTypes ogreLightType
Light type.
Definition: gz/rendering/ogre2/Ogre2Light.hh:118