Gazebo Rendering

API Reference

6.6.3
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 ignition
25 {
26  namespace rendering
27  {
28  inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
29  //
32  class IGNITION_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 IGNITION_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 IGNITION_RENDERING_VISIBLE PointLight :
145  public virtual Light
146  {
148  public: virtual ~PointLight() { }
149  };
150 
153  class IGNITION_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
virtual void SetAttenuationConstant(double _value)=0
Set the attenuation constant value.
virtual math::Color DiffuseColor() const =0
Get the diffuse color.
Represents a single posable node in the scene graph.
Definition: gz/rendering/Node.hh:51
virtual bool CastShadows() const =0
Determine if this light cast shadows.
virtual double AttenuationConstant() const =0
Get the attenuation constant value.
virtual void SetAttenuationLinear(double _value)=0
Set the attenuation linear value.
virtual math::Angle OuterAngle() const =0
Get the outer angle of the spotlight.
virtual void SetAttenuationRange(double _range)=0
Set the attenuation range.
virtual void SetOuterAngle(double _radians)=0
Set the outer angle of the spotlight.
Represents a spotlight.
Definition: gz/rendering/Light.hh:153
virtual double AttenuationLinear() const =0
Get the attenuation linear value.
virtual void SetSpecularColor(double _r, double _g, double _b, double _a=1.0)=0
Set the specular color.
virtual void SetInnerAngle(double _radians)=0
Set the inner angle of the spotlight.
virtual double AttenuationQuadratic() const =0
Get the attenuation quadratic value.
virtual math::Vector3d Direction() const =0
Get direction of the light.
virtual ~PointLight()
Deconstructor.
Definition: gz/rendering/Light.hh:148
virtual void SetDirection(double _x, double _y, double _z)=0
Set the direction of the light.
virtual void SetCastShadows(bool _castShadows)=0
Specify if this light should cast shadows.
virtual void SetDirection(double _x, double _y, double _z)=0
Set the direction of the light.
virtual math::Color SpecularColor() const =0
Get the specular color.
virtual void SetIntensity(double _intensity)=0
Set the light intensity.
Represents a infinite directional light.
Definition: gz/rendering/Light.hh:121
virtual void SetDiffuseColor(double _r, double _g, double _b, double _a=1.0)=0
Set the diffuse color.
virtual double Intensity() const =0
Get the light intensity.
virtual void SetAttenuationQuadratic(double _value)=0
Set the attenuation quadratic value.
virtual double AttenuationRange() const =0
Get the attenuation range.
Represents a point light.
Definition: gz/rendering/Light.hh:144
Represents a light source in the scene graph.
Definition: gz/rendering/Light.hh:32
virtual void SetFalloff(double _falloff)=0
Set the falloff of the spotlight.
virtual ~Light()
Deconstructor.
Definition: gz/rendering/Light.hh:36
virtual math::Angle InnerAngle() const =0
Get the inner angle of the spotlight.
virtual ~SpotLight()
Deconstructor.
Definition: gz/rendering/Light.hh:157
virtual double Falloff() const =0
Get the falloff of the spotlight.
virtual ~DirectionalLight()
Destructor.
Definition: gz/rendering/Light.hh:125
virtual math::Vector3d Direction() const =0
Get the direction of the light.