Gazebo Rendering

API Reference

3.7.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 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  };
110 
113  class IGNITION_RENDERING_VISIBLE DirectionalLight :
114  public virtual Light
115  {
117  public: virtual ~DirectionalLight() { }
118 
121  public: virtual math::Vector3d Direction() const = 0;
122 
127  public: virtual void SetDirection(double _x, double _y, double _z) = 0;
128 
131  public: virtual void SetDirection(const math::Vector3d &_dir) = 0;
132  };
133 
136  class IGNITION_RENDERING_VISIBLE PointLight :
137  public virtual Light
138  {
140  public: virtual ~PointLight() { }
141  };
142 
145  class IGNITION_RENDERING_VISIBLE SpotLight :
146  public virtual Light
147  {
149  public: virtual ~SpotLight() { }
150 
153  public: virtual math::Vector3d Direction() const = 0;
154 
159  public: virtual void SetDirection(double _x, double _y, double _z) = 0;
160 
163  public: virtual void SetDirection(const math::Vector3d &_dir) = 0;
164 
167  public: virtual math::Angle InnerAngle() const = 0;
168 
171  public: virtual void SetInnerAngle(double _radians) = 0;
172 
175  public: virtual void SetInnerAngle(const math::Angle &_angle) = 0;
176 
179  public: virtual math::Angle OuterAngle() const = 0;
180 
183  public: virtual void SetOuterAngle(double _radians) = 0;
184 
187  public: virtual void SetOuterAngle(const math::Angle &_angle) = 0;
188 
191  public: virtual double Falloff() const = 0;
192 
195  public: virtual void SetFalloff(double _falloff) = 0;
196  };
197  }
198  }
199 }
200 #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:37
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:145
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:140
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.
Represents a infinite directional light.
Definition: gz/rendering/Light.hh:113
virtual void SetDiffuseColor(double _r, double _g, double _b, double _a=1.0)=0
Set the diffuse color.
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:136
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:149
virtual double Falloff() const =0
Get the falloff of the spotlight.
virtual ~DirectionalLight()
Destructor.
Definition: gz/rendering/Light.hh:117
virtual math::Vector3d Direction() const =0
Get the direction of the light.