SO3Engine
SO3SkyLight.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
32#ifndef __SO3SKY_LIGHT_H__
33#define __SO3SKY_LIGHT_H__
34
37
38namespace SO3
39{
40
41class _SO3_Export SSkyLight : public SData
42{
43public:
44protected:
46 Ogre::SceneManager* ogreSceneManager;
47 Ogre::Light* ogreSkyLight;
48 Ogre::SceneNode* ogreSkyLightSceneNode;
49 double lastJulDay;
50 Ogre::Degree lastLatitude;
51 Ogre::Degree lastLongitude;
52 Ogre::ColourValue baseColour;
55private:
56
57public:
60 SSkyLight(SEnvironment* parent, const std::string& skyLightName, const Ogre::ColourValue& defaultBaseColour);
61
65 virtual ~SSkyLight();
66
69 SEnvironment* GetEnvironment();
70
73 void Update();
74
77 const Ogre::Vector3 GetLightDirection() const;
78
81 void SetLightDirection(const Ogre::Vector3& direction);
82
85 const Ogre::ColourValue GetLightColour(const float& level=1.0f) const;
86
89 void SetLightColour(const Ogre::ColourValue& newColour);
90
94 bool GetEnable();
95
99 void SetEnable(const bool& enable);
100
104 bool GetCastShadowEnable();
105
109 void SetCastShadowEnable(const bool& enable);
110
111 void UpdateShadowFarDistance(const float& distance);
112
113 void UpdateShadowFarClipDistance(const float& distance);
114
115 Ogre::Light* GetOgreLight();
116protected:
119 virtual const Ogre::Vector3 ComputeDirectionImpl(const double& julianDay)=0;
120
123 const Ogre::Vector3 MakeDirection (const Ogre::Degree& azimuth, const Ogre::Degree& altitude);
124private:
128 SSkyLight();
129
132 void RefreshLightColourGradient();
133};
134
135}
136
137#endif
Ogre::SceneManager * ogreSceneManager
Definition SO3SkyLight.h:46
SEnvironment * parentEnvironment
Definition SO3SkyLight.h:45
Ogre::Degree lastLatitude
Definition SO3SkyLight.h:50
Ogre::SceneNode * ogreSkyLightSceneNode
Definition SO3SkyLight.h:48
Ogre::Degree lastLongitude
Definition SO3SkyLight.h:51
Ogre::Light * ogreSkyLight
Definition SO3SkyLight.h:47
double lastJulDay
Definition SO3SkyLight.h:49
SColourGradient lightColourGradient
Definition SO3SkyLight.h:53
virtual const Ogre::Vector3 ComputeDirectionImpl(const double &julianDay)=0
Ogre::ColourValue baseColour
Definition SO3SkyLight.h:52