Ignition Rendering

API Reference

4.1.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 IGNITION_RENDERING_LIGHT_HH_
18 #define IGNITION_RENDERING_LIGHT_HH_
19 
20 #include "ignition/math/Color.hh"
21 #include "ignition/rendering/config.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 ~Light()
Deconstructor.
Definition: Light.hh:36
virtual ~PointLight()
Deconstructor.
Definition: Light.hh:140
Represents a single posable node in the scene graph.
Definition: Node.hh:37
virtual ~SpotLight()
Deconstructor.
Definition: Light.hh:149
Represents a point light.
Definition: Light.hh:136
Represents a light source in the scene graph.
Definition: Light.hh:32
Represents a spotlight.
Definition: Light.hh:145
Represents a infinite directional light.
Definition: Light.hh:113
virtual ~DirectionalLight()
Destructor.
Definition: Light.hh:117