Gazebo Rendering

API Reference

9.0.0
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
24namespace Ogre
25{
26 class Light;
27}
28
29namespace gz
30{
31 namespace rendering
32 {
33 inline namespace GZ_RENDERING_VERSION_NAMESPACE {
34 //
35 class GZ_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 GZ_RENDERING_OGRE_VISIBLE OgreDirectionalLight :
101 public BaseDirectionalLight<OgreLight>
102 {
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 GZ_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 GZ_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