Ignition Rendering

API Reference

0.1.0
OgreLight.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_OGRE_OGRELIGHT_HH_
18 #define IGNITION_RENDERING_OGRE_OGRELIGHT_HH_
19 
23 
24 namespace Ogre
25 {
26  class Light;
27 }
28 
29 namespace ignition
30 {
31  namespace rendering
32  {
33  class IGNITION_RENDERING_OGRE_VISIBLE OgreLight :
34  public BaseLight<OgreNode>
35  {
36  protected: OgreLight();
37 
38  public: virtual ~OgreLight();
39 
40  public: virtual math::Color DiffuseColor() const;
41 
42  public: virtual void SetDiffuseColor(const math::Color &_color);
43 
44  public: virtual math::Color SpecularColor() const;
45 
46  public: virtual void SetSpecularColor(const math::Color &_color);
47 
48  public: virtual double AttenuationConstant() const;
49 
50  public: virtual void SetAttenuationConstant(double _value);
51 
52  public: virtual double AttenuationLinear() const;
53 
54  public: virtual void SetAttenuationLinear(double _value);
55 
56  public: virtual double AttenuationQuadratic() const;
57 
58  public: virtual void SetAttenuationQuadratic(double _value);
59 
60  public: virtual double AttenuationRange() const;
61 
62  public: virtual void SetAttenuationRange(double _range);
63 
64  public: virtual bool CastShadows() const;
65 
66  public: virtual void SetCastShadows(bool _castShadows);
67 
68  public: virtual Ogre::Light *Light() const;
69 
70  public: virtual void Destroy();
71 
72  protected: virtual void Init();
73 
74  private: void CreateLight();
75 
76  private: void UpdateAttenuation();
77 
78  protected: double attenConstant;
79 
80  protected: double attenLinear;
81 
82  protected: double attenQuadratic;
83 
84  protected: double attenRange;
85 
86  protected: Ogre::Light *ogreLight;
87 
89  };
90 
91  class IGNITION_RENDERING_OGRE_VISIBLE OgreDirectionalLight :
92  public BaseDirectionalLight<OgreLight>
93  {
94  protected: OgreDirectionalLight();
95 
96  public: virtual ~OgreDirectionalLight();
97 
98  public: virtual math::Vector3d Direction() const;
99 
100  public: virtual void SetDirection(const math::Vector3d &_dir);
101 
102  private: friend class OgreScene;
103  };
104 
105  class IGNITION_RENDERING_OGRE_VISIBLE OgrePointLight :
106  public BasePointLight<OgreLight>
107  {
108  protected: OgrePointLight();
109 
110  public: virtual ~OgrePointLight();
111 
112  private: friend class OgreScene;
113  };
114 
115  class IGNITION_RENDERING_OGRE_VISIBLE OgreSpotLight :
116  public BaseSpotLight<OgreLight>
117  {
118  protected: OgreSpotLight();
119 
120  public: virtual ~OgreSpotLight();
121 
122  public: virtual math::Vector3d Direction() const;
123 
124  public: virtual void SetDirection(const math::Vector3d &_dir);
125 
126  public: virtual math::Angle InnerAngle() const;
127 
128  public: virtual void SetInnerAngle(const math::Angle &_angle);
129 
130  public: virtual math::Angle OuterAngle() const;
131 
132  public: virtual void SetOuterAngle(const math::Angle &_angle);
133 
134  public: virtual double Falloff() const;
135 
136  public: virtual void SetFalloff(double _falloff);
137 
138  private: friend class OgreScene;
139  };
140  }
141 }
142 #endif
Definition: BaseLight.hh:27
double attenQuadratic
Definition: OgreLight.hh:82
Definition: BaseLight.hh:75
double attenRange
Definition: OgreLight.hh:84
Definition: OgreLight.hh:33
Definition: OgreLight.hh:105
Definition: BaseLight.hh:85
Ogre::Light::LightTypes ogreLightType
Definition: OgreLight.hh:88
Represents a light source in the scene graph.
Definition: Light.hh:29
Ogre::Light * ogreLight
Definition: OgreLight.hh:86
Definition: OgreScene.hh:34
Definition: OgreLight.hh:115
Definition: ArrowVisual.hh:22
double attenLinear
Definition: OgreLight.hh:80
double attenConstant
Definition: OgreLight.hh:78