SO3Engine
SO3Light.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
33#ifndef __SO3LIGHT_H__
34#define __SO3LIGHT_H__
35
39
40namespace SO3
41{
42
43class SLight : public SNode
44{
45public:
53protected:
54private:
55 Ogre::Light* O3Light;
56 Ogre::Real mShadowFarDistance;
57 SLightShaft* mLightShaft;
58 bool mVolumetric;
59 float mRange;
60public:
64 SLight(SScene* parent, const std::string& lightName);
65
68 ~SLight();
69
72 Ogre::Light* GetOgreLightPointer();
73
76 void SetVolumetric(bool state);
77
80 bool GetVolumetric();
81
84 void SetDiffuseColour(const int& diffuseColor);
85
88 int GetDiffuseColour();
89
92 void SetSpecularColour(const int& specularColor);
93
96 void SetDiffuseColour(Ogre::ColourValue color);
97
100 void SetSpecularColour(Ogre::ColourValue color);
101
104 int GetSpecularColour();
105
108 void SetPowerScale(const float& powerScale);
109
112 float GetPowerScale();
113
116 void SetVisible(const bool& isVisible);
117
120 bool GetVisible();
121
124 void SetAttenuation(const float& range, const float& constant, const float& linear, const float& quadratic);
125
130 void SetAttenuation(const float& range);
131
134 Ogre::Vector4 GetAttenuation();
135
138 void SetShadowFarDistance(const float& distance);
139
142 void UpdateShadowFarDistance(const float& distance);
143
146 void UpdateShadowFarClipDistance(const float& distance);
147
150 float GetShadowFarDistance();
151
154 void SetType(const LightType& type);
155
159
162 void SetSpotlightInnerAngle(const float& radianAngle);
163
167
170 void SetSpotlightOuterAngle(const float& radianAngle);
171
175
178 void SetSpotlightFalloff(const float& value);
179
182 float GetSpotlightFalloff();
183
186 void SetSourceSize(float x, float y);
187
190 Ogre::Vector2f GetSourceSize();
191
195 virtual void SetCastShadows(const bool& castShadows);
196
200 virtual bool GetCastShadows();
201
205 virtual void SetRenderingDistance(const float& distance);
206
210 virtual float GetRenderingDistance();
211
215 virtual Ogre::Vector3 GetBoundingBoxSize(const bool& childs = false);
216
220 virtual Ogre::Vector3 GetBoundingBoxCenter(const bool& childs = false);
221
225 virtual Ogre::Vector3 GetWorldBoundingBoxSize(const bool& childs = false);
226
230 virtual Ogre::Vector3 GetWorldBoundingBoxCenter(const bool& childs = false);
231protected:
232private:
236 SLight();
237
240 void UpdateVolumetric(bool force = false);
241};
242
243}
244
245#endif
librairies include
virtual void SetRenderingDistance(const float &distance)
Definition SO3Light.cpp:286
void SetAttenuation(const float &range, const float &constant, const float &linear, const float &quadratic)
Definition SO3Light.cpp:172
bool GetVolumetric()
Definition SO3Light.cpp:100
virtual float GetRenderingDistance()
Definition SO3Light.cpp:291
void SetSpotlightInnerAngle(const float &radianAngle)
Definition SO3Light.cpp:230
virtual bool GetCastShadows()
Definition SO3Light.cpp:281
Ogre::Vector2f GetSourceSize()
Definition SO3Light.cpp:267
virtual void SetCastShadows(const bool &castShadows)
Definition SO3Light.cpp:272
void SetDiffuseColour(const int &diffuseColor)
Definition SO3Light.cpp:116
Ogre::Light * GetOgreLightPointer()
Definition SO3Light.cpp:45
bool GetVisible()
Definition SO3Light.cpp:167
void SetPowerScale(const float &powerScale)
Definition SO3Light.cpp:137
float GetSpotlightInnerAngle()
Definition SO3Light.cpp:235
Ogre::Vector4 GetAttenuation()
Definition SO3Light.cpp:187
void SetSpotlightOuterAngle(const float &radianAngle)
Definition SO3Light.cpp:240
float GetPowerScale()
Definition SO3Light.cpp:144
void SetShadowFarDistance(const float &distance)
Definition SO3Light.cpp:195
virtual Ogre::Vector3 GetBoundingBoxCenter(const bool &childs=false)
Definition SO3Light.cpp:304
virtual Ogre::Vector3 GetWorldBoundingBoxSize(const bool &childs=false)
Definition SO3Light.cpp:309
void SetSpotlightFalloff(const float &value)
Definition SO3Light.cpp:251
void SetVisible(const bool &isVisible)
Definition SO3Light.cpp:149
void SetType(const LightType &type)
Definition SO3Light.cpp:218
void SetSourceSize(float x, float y)
Definition SO3Light.cpp:261
@ SO3_RECT_LIGHT
Definition SO3Light.h:51
@ SO3_SPOT_LIGHT
Definition SO3Light.h:50
@ SO3_POINT_LIGHT
Definition SO3Light.h:48
@ SO3_DIRECTIONAL_LIGHT
Definition SO3Light.h:49
void UpdateShadowFarDistance(const float &distance)
Definition SO3Light.cpp:201
LightType GetType()
Definition SO3Light.cpp:225
float GetSpotlightOuterAngle()
Definition SO3Light.cpp:246
void SetSpecularColour(const int &specularColor)
Definition SO3Light.cpp:127
int GetDiffuseColour()
Definition SO3Light.cpp:122
void SetVolumetric(bool state)
Definition SO3Light.cpp:94
virtual Ogre::Vector3 GetBoundingBoxSize(const bool &childs=false)
Definition SO3Light.cpp:296
float GetSpotlightFalloff()
Definition SO3Light.cpp:256
int GetSpecularColour()
Definition SO3Light.cpp:132
float GetShadowFarDistance()
Definition SO3Light.cpp:213
void UpdateShadowFarClipDistance(const float &distance)
Definition SO3Light.cpp:207
virtual Ogre::Vector3 GetWorldBoundingBoxCenter(const bool &childs=false)
Definition SO3Light.cpp:317