Gazebo Rendering

API Reference

9.0.0
Light.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_LIGHT_HH_
18#define GZ_RENDERING_LIGHT_HH_
19
20#include "gz/math/Color.hh"
21#include "gz/rendering/config.hh"
22#include "gz/rendering/Node.hh"
23
24namespace gz
25{
26 namespace rendering
27 {
28 inline namespace GZ_RENDERING_VERSION_NAMESPACE {
29
32 enum class GZ_RENDERING_VISIBLE LightType
33 {
35 EMPTY = 0,
36
38 POINT = 1,
39
41 DIRECTIONAL = 2,
42
44 SPOT = 3
45 };
46
47 //
50 class GZ_RENDERING_VISIBLE Light :
51 public virtual Node
52 {
54 public: virtual ~Light();
55
58 public: virtual math::Color DiffuseColor() const = 0;
59
65 public: virtual void SetDiffuseColor(double _r, double _g, double _b,
66 double _a = 1.0) = 0;
67
70 public: virtual void SetDiffuseColor(const math::Color &_color) = 0;
71
74 public: virtual math::Color SpecularColor() const = 0;
75
81 public: virtual void SetSpecularColor(double _r, double _g, double _b,
82 double _a = 1.0) = 0;
83
86 public: virtual void SetSpecularColor(const math::Color &_color) = 0;
87
90 public: virtual double AttenuationConstant() const = 0;
91
94 public: virtual void SetAttenuationConstant(double _value) = 0;
95
98 public: virtual double AttenuationLinear() const = 0;
99
102 public: virtual void SetAttenuationLinear(double _value) = 0;
103
106 public: virtual double AttenuationQuadratic() const = 0;
107
110 public: virtual void SetAttenuationQuadratic(double _value) = 0;
111
114 public: virtual double AttenuationRange() const = 0;
115
118 public: virtual void SetAttenuationRange(double _range) = 0;
119
122 public: virtual bool CastShadows() const = 0;
123
126 public: virtual void SetCastShadows(bool _castShadows) = 0;
127
130 public: virtual double Intensity() const = 0;
131
134 public: virtual void SetIntensity(double _intensity) = 0;
135 };
136
139 class GZ_RENDERING_VISIBLE DirectionalLight :
140 public virtual Light
141 {
143 public: virtual ~DirectionalLight();
144
147 public: virtual math::Vector3d Direction() const = 0;
148
153 public: virtual void SetDirection(double _x, double _y, double _z) = 0;
154
157 public: virtual void SetDirection(const math::Vector3d &_dir) = 0;
158 };
159
162 class GZ_RENDERING_VISIBLE PointLight :
163 public virtual Light
164 {
166 public: virtual ~PointLight();
167 };
168
171 class GZ_RENDERING_VISIBLE SpotLight :
172 public virtual Light
173 {
175 public: virtual ~SpotLight();
176
179 public: virtual math::Vector3d Direction() const = 0;
180
185 public: virtual void SetDirection(double _x, double _y, double _z) = 0;
186
189 public: virtual void SetDirection(const math::Vector3d &_dir) = 0;
190
193 public: virtual math::Angle InnerAngle() const = 0;
194
197 public: virtual void SetInnerAngle(double _radians) = 0;
198
201 public: virtual void SetInnerAngle(const math::Angle &_angle) = 0;
202
205 public: virtual math::Angle OuterAngle() const = 0;
206
209 public: virtual void SetOuterAngle(double _radians) = 0;
210
213 public: virtual void SetOuterAngle(const math::Angle &_angle) = 0;
214
217 public: virtual double Falloff() const = 0;
218
221 public: virtual void SetFalloff(double _falloff) = 0;
222 };
223 }
224 }
225}
226#endif