Gazebo Rendering

API Reference

6.6.4
gz/rendering/ogre/OgreLight.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 GZ_RENDERING_OGRE_OGRELIGHT_HH_
18 #define GZ_RENDERING_OGRE_OGRELIGHT_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  //
35  class IGNITION_RENDERING_OGRE_VISIBLE OgreLight :
36  public BaseLight<OgreNode>
37  {
38  protected: OgreLight();
39 
40  public: virtual ~OgreLight();
41 
42  public: virtual math::Color DiffuseColor() const override;
43 
44  public: virtual void SetDiffuseColor(const math::Color &_color) override;
45 
46  public: virtual math::Color SpecularColor() const override;
47 
48  public: virtual void SetSpecularColor(
49  const math::Color &_color) override;
50 
51  public: virtual double AttenuationConstant() const override;
52 
53  public: virtual void SetAttenuationConstant(double _value) override;
54 
55  public: virtual double AttenuationLinear() const override;
56 
57  public: virtual void SetAttenuationLinear(double _value) override;
58 
59  public: virtual double AttenuationQuadratic() const override;
60 
61  public: virtual void SetAttenuationQuadratic(double _value) override;
62 
63  public: virtual double AttenuationRange() const override;
64 
65  public: virtual void SetAttenuationRange(double _range) override;
66 
67  public: virtual bool CastShadows() const override;
68 
69  public: virtual void SetCastShadows(bool _castShadows) override;
70 
71  // Documentation Inherited
72  public: virtual double Intensity() const override;
73 
74  // Documentation Inherited
75  public: virtual void SetIntensity(double _intensity) override;
76 
77  public: virtual Ogre::Light *Light() const;
78 
79  public: virtual void Destroy() override;
80 
81  protected: virtual void Init() override;
82 
83  private: void CreateLight();
84 
85  private: void UpdateAttenuation();
86 
87  protected: double attenConstant;
88 
89  protected: double attenLinear;
90 
91  protected: double attenQuadratic;
92 
93  protected: double attenRange;
94 
95  protected: Ogre::Light *ogreLight;
96 
97  protected: Ogre::Light::LightTypes ogreLightType;
98  };
99 
100  class IGNITION_RENDERING_OGRE_VISIBLE OgreDirectionalLight :
101  public BaseDirectionalLight<OgreLight>
102  {
103  protected: OgreDirectionalLight();
104 
105  public: virtual ~OgreDirectionalLight();
106 
107  public: virtual math::Vector3d Direction() const;
108 
109  public: virtual void SetDirection(const math::Vector3d &_dir);
110 
111  private: friend class OgreScene;
112  };
113 
114  class IGNITION_RENDERING_OGRE_VISIBLE OgrePointLight :
115  public BasePointLight<OgreLight>
116  {
117  protected: OgrePointLight();
118 
119  public: virtual ~OgrePointLight();
120 
121  private: friend class OgreScene;
122  };
123 
124  class IGNITION_RENDERING_OGRE_VISIBLE OgreSpotLight :
125  public BaseSpotLight<OgreLight>
126  {
127  protected: OgreSpotLight();
128 
129  public: virtual ~OgreSpotLight();
130 
131  public: virtual math::Vector3d Direction() const;
132 
133  public: virtual void SetDirection(const math::Vector3d &_dir);
134 
135  public: virtual math::Angle InnerAngle() const;
136 
137  public: virtual void SetInnerAngle(const math::Angle &_angle);
138 
139  public: virtual math::Angle OuterAngle() const;
140 
141  public: virtual void SetOuterAngle(const math::Angle &_angle);
142 
143  public: virtual double Falloff() const;
144 
145  public: virtual void SetFalloff(double _falloff);
146 
147  private: friend class OgreScene;
148  };
149  }
150  }
151 }
152 #endif
Definition: gz/rendering/base/BaseLight.hh:74
Definition: gz/rendering/base/BaseLight.hh:32
Definition: gz/rendering/base/BaseLight.hh:90
Definition: gz/rendering/base/BaseLight.hh:100
Definition: gz/rendering/ogre/OgreLight.hh:102
virtual math::Vector3d Direction() const
Get the direction of the light.
virtual void SetDirection(const math::Vector3d &_dir)
Set the direction of the light.
Definition: gz/rendering/ogre/OgreLight.hh:37
virtual double Intensity() const override
Get the light intensity.
double attenConstant
Definition: gz/rendering/ogre/OgreLight.hh:87
virtual Ogre::Light * Light() const
virtual bool CastShadows() const override
Determine if this light cast shadows.
virtual void SetCastShadows(bool _castShadows) override
Specify if this light should cast shadows.
virtual double AttenuationLinear() const override
Get the attenuation linear value.
virtual double AttenuationQuadratic() const override
Get the attenuation quadratic value.
double attenQuadratic
Definition: gz/rendering/ogre/OgreLight.hh:91
virtual void SetAttenuationLinear(double _value) override
Set the attenuation linear value.
virtual void SetAttenuationQuadratic(double _value) override
Set the attenuation quadratic value.
virtual void SetAttenuationConstant(double _value) override
Set the attenuation constant value.
double attenLinear
Definition: gz/rendering/ogre/OgreLight.hh:89
virtual double AttenuationRange() const override
Get the attenuation range.
virtual void Destroy() override
Destroy any resources associated with this object. Invoking any other functions after destroying an o...
virtual void SetIntensity(double _intensity) override
Set the light intensity.
Ogre::Light * ogreLight
Definition: gz/rendering/ogre/OgreLight.hh:95
virtual math::Color SpecularColor() const override
Get the specular color.
virtual void SetDiffuseColor(const math::Color &_color) override
Set the diffuse color.
virtual void SetSpecularColor(const math::Color &_color) override
Set the specular color.
virtual void Init() override
virtual math::Color DiffuseColor() const override
Get the diffuse color.
Ogre::Light::LightTypes ogreLightType
Definition: gz/rendering/ogre/OgreLight.hh:97
virtual double AttenuationConstant() const override
Get the attenuation constant value.
virtual void SetAttenuationRange(double _range) override
Set the attenuation range.
double attenRange
Definition: gz/rendering/ogre/OgreLight.hh:93
Definition: gz/rendering/ogre/OgreLight.hh:116
Definition: gz/rendering/ogre/OgreScene.hh:41
Definition: gz/rendering/ogre/OgreLight.hh:126
virtual math::Vector3d Direction() const
Get direction of the light.
virtual void SetOuterAngle(const math::Angle &_angle)
Set the outer angle of the spotlight.
virtual void SetInnerAngle(const math::Angle &_angle)
Set the inner angle of the spotlight.
virtual math::Angle OuterAngle() const
Get the outer angle of the spotlight.
virtual double Falloff() const
Get the falloff of the spotlight.
virtual math::Angle InnerAngle() const
Get the inner angle of the spotlight.
virtual void SetDirection(const math::Vector3d &_dir)
Set the direction of the light.
virtual void SetFalloff(double _falloff)
Set the falloff of the spotlight.
Definition: gz/rendering/ogre/OgreCamera.hh:28