Gazebo Rendering

API Reference

7.4.2
gz/rendering/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 
24 namespace gz
25 {
26  namespace rendering
27  {
28  inline namespace GZ_RENDERING_VERSION_NAMESPACE {
29  //
32  class GZ_RENDERING_VISIBLE Light :
33  public virtual Node
34  {
36  public: virtual ~Light();
37 
40  public: virtual math::Color DiffuseColor() const = 0;
41 
47  public: virtual void SetDiffuseColor(double _r, double _g, double _b,
48  double _a = 1.0) = 0;
49 
52  public: virtual void SetDiffuseColor(const math::Color &_color) = 0;
53 
56  public: virtual math::Color SpecularColor() const = 0;
57 
63  public: virtual void SetSpecularColor(double _r, double _g, double _b,
64  double _a = 1.0) = 0;
65 
68  public: virtual void SetSpecularColor(const math::Color &_color) = 0;
69 
72  public: virtual double AttenuationConstant() const = 0;
73 
76  public: virtual void SetAttenuationConstant(double _value) = 0;
77 
80  public: virtual double AttenuationLinear() const = 0;
81 
84  public: virtual void SetAttenuationLinear(double _value) = 0;
85 
88  public: virtual double AttenuationQuadratic() const = 0;
89 
92  public: virtual void SetAttenuationQuadratic(double _value) = 0;
93 
96  public: virtual double AttenuationRange() const = 0;
97 
100  public: virtual void SetAttenuationRange(double _range) = 0;
101 
104  public: virtual bool CastShadows() const = 0;
105 
108  public: virtual void SetCastShadows(bool _castShadows) = 0;
109 
112  public: virtual double Intensity() const = 0;
113 
116  public: virtual void SetIntensity(double _intensity) = 0;
117  };
118 
121  class GZ_RENDERING_VISIBLE DirectionalLight :
122  public virtual Light
123  {
125  public: virtual ~DirectionalLight();
126 
129  public: virtual math::Vector3d Direction() const = 0;
130 
135  public: virtual void SetDirection(double _x, double _y, double _z) = 0;
136 
139  public: virtual void SetDirection(const math::Vector3d &_dir) = 0;
140  };
141 
144  class GZ_RENDERING_VISIBLE PointLight :
145  public virtual Light
146  {
148  public: virtual ~PointLight();
149  };
150 
153  class GZ_RENDERING_VISIBLE SpotLight :
154  public virtual Light
155  {
157  public: virtual ~SpotLight();
158 
161  public: virtual math::Vector3d Direction() const = 0;
162 
167  public: virtual void SetDirection(double _x, double _y, double _z) = 0;
168 
171  public: virtual void SetDirection(const math::Vector3d &_dir) = 0;
172 
175  public: virtual math::Angle InnerAngle() const = 0;
176 
179  public: virtual void SetInnerAngle(double _radians) = 0;
180 
183  public: virtual void SetInnerAngle(const math::Angle &_angle) = 0;
184 
187  public: virtual math::Angle OuterAngle() const = 0;
188 
191  public: virtual void SetOuterAngle(double _radians) = 0;
192 
195  public: virtual void SetOuterAngle(const math::Angle &_angle) = 0;
196 
199  public: virtual double Falloff() const = 0;
200 
203  public: virtual void SetFalloff(double _falloff) = 0;
204  };
205  }
206  }
207 }
208 #endif