RigsofRods
Soft-body Physics Simulation
VCloudsManager.h
Go to the documentation of this file.
1 /*
2 --------------------------------------------------------------------------------
3 This source file is part of SkyX.
4 Visit http://www.paradise-studios.net/products/skyx/
5 
6 Copyright (C) 2009-2012 Xavier Verguín González <xavyiy@gmail.com>
7 
8 This program is free software; you can redistribute it and/or modify it under
9 the terms of the GNU Lesser General Public License as published by the Free Software
10 Foundation; either version 2 of the License, or (at your option) any later
11 version.
12 
13 This program is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License along with
18 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20 http://www.gnu.org/copyleft/lesser.txt.
21 --------------------------------------------------------------------------------
22 */
23 
24 #ifndef _SkyX_VCloudsManager_H_
25 #define _SkyX_VCloudsManager_H_
26 
27 #include "Prerequisites.h"
28 
29 #include "VClouds/VClouds.h"
30 #include "ColorGradient.h"
31 
32 namespace SkyX
33 {
34  class SkyX;
35 
37  {
38  public:
42  VCloudsManager(SkyX *s);
43 
47 
51  void create(const Ogre::Real& radius = -1);
52 
56  void update(const Ogre::Real& timeSinceLastFrame);
57 
63  void notifyCameraRender(Ogre::Camera* c);
64 
67  void remove();
68 
72  inline void setAmbientGradient(const ColorGradient& AmbientGradient)
73  {
74  mAmbientGradient = AmbientGradient;
75  }
76 
80  inline const ColorGradient& getAmbientGradient() const
81  {
82  return mAmbientGradient;
83  }
84 
88  inline void setSunGradient(const ColorGradient& SunGradient)
89  {
90  mSunGradient = SunGradient;
91  }
92 
96  inline const ColorGradient& getSunGradient() const
97  {
98  return mSunGradient;
99  }
100 
106  inline void setHeight(const Ogre::Vector2& Height)
107  {
108  mHeight = Height;
109  }
110 
114  inline const Ogre::Vector2& getHeight() const
115  {
116  return mHeight;
117  }
118 
122  inline void setAutoupdate(const bool& Autoupdate)
123  {
124  mAutoupdate = Autoupdate;
126  }
127 
131  inline const bool& getAutoupdate() const
132  {
133  return mAutoupdate;
134  }
135 
139  inline void setWindSpeed(const Ogre::Real& WindSpeed)
140  {
141  mWindSpeed = WindSpeed;
143  }
144 
148  inline const Ogre::Real& getWindSpeed() const
149  {
150  return mWindSpeed;
151  }
152 
156  {
157  return mVClouds;
158  }
159 
163  inline const bool& isCreated() const
164  {
165  return mCreated;
166  }
167 
171  void _updateWindSpeedConfig();
172 
173  private:
176  void _setLightParameters();
177 
181 
184 
186  Ogre::Vector2 mHeight;
187 
191  Ogre::Real mWindSpeed;
192 
194  bool mCreated;
195 
198 
201  };
202 }
203 
204 #endif
SkyX::VCloudsManager::getAmbientGradient
const ColorGradient & getAmbientGradient() const
Get ambient color gradient.
Definition: VCloudsManager.h:80
SkyX::ColorGradient
Definition: ColorGradient.h:31
VClouds.h
SkyX::VCloudsManager::getVClouds
VClouds::VClouds * getVClouds()
Get VClouds.
Definition: VCloudsManager.h:155
SkyX::VCloudsManager::mSkyX
SkyX * mSkyX
SkyX parent pointer.
Definition: VCloudsManager.h:200
SkyX::VCloudsManager::notifyCameraRender
void notifyCameraRender(Ogre::Camera *c)
Notify camera render, to be invoked per-camera and per-frame.
Definition: VCloudsManager.cpp:106
ColorGradient.h
Prerequisites.h
SkyX::VCloudsManager::_updateWindSpeedConfig
void _updateWindSpeedConfig()
Update wind speed config.
Definition: VCloudsManager.cpp:146
SkyX
Definition: AtmosphereManager.cpp:30
SkyX::VCloudsManager::mAmbientGradient
ColorGradient mAmbientGradient
Ambient and Sun color gradients.
Definition: VCloudsManager.h:179
SkyX::VCloudsManager::mHeight
Ogre::Vector2 mHeight
Height parameters, x = Cloud field y-coord start, y: Field height (both in world coordinates)
Definition: VCloudsManager.h:186
SkyX::VCloudsManager::update
void update(const Ogre::Real &timeSinceLastFrame)
Update.
Definition: VCloudsManager.cpp:92
SkyX::VCloudsManager::getWindSpeed
const Ogre::Real & getWindSpeed() const
Get wind speed.
Definition: VCloudsManager.h:148
SkyX::VCloudsManager::getAutoupdate
const bool & getAutoupdate() const
Get autoupdate.
Definition: VCloudsManager.h:131
SkyX::VCloudsManager
Definition: VCloudsManager.h:36
SkyX::VCloudsManager::setAmbientGradient
void setAmbientGradient(const ColorGradient &AmbientGradient)
Set ambient gradient.
Definition: VCloudsManager.h:72
SkyX::VCloudsManager::mSunGradient
ColorGradient mSunGradient
Definition: VCloudsManager.h:180
SkyX::VCloudsManager::setAutoupdate
void setAutoupdate(const bool &Autoupdate)
Autoupdate volumetric clouds wind depending of the SkyX time multiplier.
Definition: VCloudsManager.h:122
SkyX::VCloudsManager::setSunGradient
void setSunGradient(const ColorGradient &SunGradient)
Set sun gradient.
Definition: VCloudsManager.h:88
SkyX::VCloudsManager::setHeight
void setHeight(const Ogre::Vector2 &Height)
Set height parameters.
Definition: VCloudsManager.h:106
SkyX::VCloudsManager::VCloudsManager
VCloudsManager(SkyX *s)
Constructor.
Definition: VCloudsManager.cpp:30
SkyX::VCloudsManager::~VCloudsManager
~VCloudsManager()
Destructor.
Definition: VCloudsManager.cpp:64
SkyX::VCloudsManager::getHeight
const Ogre::Vector2 & getHeight() const
Get height parameters.
Definition: VCloudsManager.h:114
SkyX::VClouds::VClouds
Definition: VClouds.h:35
SkyX::VCloudsManager::mWindSpeed
Ogre::Real mWindSpeed
Wind speed.
Definition: VCloudsManager.h:191
SkyX::VCloudsManager::isCreated
const bool & isCreated() const
Is moon manager created?
Definition: VCloudsManager.h:163
SkyX::VCloudsManager::create
void create(const Ogre::Real &radius=-1)
Create all resources.
Definition: VCloudsManager.cpp:71
SkyX::VCloudsManager::mVClouds
VClouds::VClouds * mVClouds
VClouds pointer.
Definition: VCloudsManager.h:183
SkyX::VCloudsManager::remove
void remove()
Remove all resources.
Definition: VCloudsManager.cpp:116
SkyX::VCloudsManager::mCurrentTimeSinceLastFrame
Ogre::Real mCurrentTimeSinceLastFrame
Current time since last frame.
Definition: VCloudsManager.h:197
SkyX::VCloudsManager::mCreated
bool mCreated
Is vclouds manager created?
Definition: VCloudsManager.h:194
SkyX::VCloudsManager::mAutoupdate
bool mAutoupdate
Autoupdate wind speed depending of skyx time multiplier?
Definition: VCloudsManager.h:189
SkyX::VCloudsManager::setWindSpeed
void setWindSpeed(const Ogre::Real &WindSpeed)
Set wind speed.
Definition: VCloudsManager.h:139
SkyX::VCloudsManager::_setLightParameters
void _setLightParameters()
Set light parameters.
Definition: VCloudsManager.cpp:128
SkyX::VCloudsManager::getSunGradient
const ColorGradient & getSunGradient() const
Get sun color gradient.
Definition: VCloudsManager.h:96