Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
SkyX.h
Go to the documentation of this file.
1/*
2--------------------------------------------------------------------------------
3This source file is part of SkyX.
4Visit http://www.paradise-studios.net/products/skyx/
5
6Copyright (C) 2009-2012 Xavier Vergu�n Gonz�lez <xavyiy@gmail.com>
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#ifndef _SkyX_SkyX_H_
25#define _SkyX_SkyX_H_
26
27#include "Prerequisites.h"
28
29#include "MeshManager.h"
30#include "AtmosphereManager.h"
31#include "GPUManager.h"
32#include "MoonManager.h"
33#include "CloudsManager.h"
34#include "ColorGradient.h"
35#include "Controller.h"
36#include "BasicController.h"
37#include "VCloudsManager.h"
38#include "VClouds/VClouds.h"
42#include "VClouds/Ellipsoid.h"
43#include "VClouds/DataManager.h"
44#include "SCfgFileManager.h"
45
46namespace SkyX
47{
61 class SkyX : public Ogre::FrameListener, public Ogre::RenderTargetListener
62 {
63 public:
67 {
74 inline RenderQueueGroups(const Ogre::uint8& s, const Ogre::uint8& vc, const Ogre::uint8& vclu, const Ogre::uint8& vclo)
75 : skydome(s), vclouds(vc), vcloudsLightningsUnder(vclu), vcloudsLightningsOver(vclo)
76 {
77 }
78
80 Ogre::uint8 skydome;
82 Ogre::uint8 vclouds;
87 };
88
97 {
99 LM_LDR = 0,
101 LM_HDR = 1
102 };
103
108 SkyX(Ogre::SceneManager* sm, Controller* c);
109
112 ~SkyX();
113
116 void create();
117
120 void remove();
121
129 void update(const Ogre::Real &timeSinceLastFrame);
130
138 void notifyCameraRender(Ogre::Camera* c);
139
143 inline const bool isCreated() const
144 {
145 return mCreated;
146 }
147
151 void setVisible(const bool& visible);
152
156 inline const bool& isVisible() const
157 {
158 return mVisible;
159 }
160
166 inline void setTimeMultiplier(const Ogre::Real& TimeMultiplier)
167 {
168 mTimeMultiplier = TimeMultiplier;
169 mVCloudsManager->_updateWindSpeedConfig();
170 }
171
175 inline const Ogre::Real& getTimeMultiplier() const
176 {
177 return mTimeMultiplier;
178 }
179
184 {
185 return mMeshManager;
186 }
187
192 {
193 return mAtmosphereManager;
194 }
195
200 {
201 return mGPUManager;
202 }
203
208 {
209 return mMoonManager;
210 }
211
216 {
217 return mCloudsManager;
218 }
219
224 {
225 return mVCloudsManager;
226 }
227
231 inline void setController(Controller* c)
232 {
233 if (mController->getDeleteBySkyX())
234 {
235 delete mController;
236 }
237
238 mController = c;
239 }
240
244 inline Controller* getController() const
245 {
246 return mController;
247 }
248
252 void setRenderQueueGroups(const RenderQueueGroups& rqg);
253
258 {
259 return mRenderQueueGroups;
260 }
261
270 void setLightingMode(const LightingMode& lm);
271
275 inline const LightingMode& getLightingMode() const
276 {
277 return mLightingMode;
278 }
279
283 void setStarfieldEnabled(const bool& Enabled);
284
288 inline const bool& isStarfieldEnabled() const
289 {
290 return mStarfield;
291 }
292
299 inline void setInfiniteCameraFarClipDistance(const Ogre::Real& d)
300 {
301 mInfiniteCameraFarClipDistance = d;
302 }
303
307 inline const Ogre::Real& getInfiniteCameraFarClipDistance() const
308 {
309 return mInfiniteCameraFarClipDistance;
310 }
311
315 inline Ogre::SceneManager* getSceneManager()
316 {
317 return mSceneManager;
318 }
319
323 inline Ogre::Camera* getCamera()
324 {
325 return mCamera;
326 }
327
331 bool frameStarted(const Ogre::FrameEvent& evt);
332
336 void preViewportUpdate(const Ogre::RenderTargetViewportEvent& evt);
337
342 inline const Ogre::Real& _getTimeOffset() const
343 {
344 return mTimeOffset;
345 }
346
348 {
349 return mCfgFileManager;
350 }
351
352 inline const bool loadCfg(const Ogre::String &File) const
353 {
354 return mCfgFileManager->load(File);
355 }
356
357 private:
360
373
376
379
381 Ogre::SceneManager *mSceneManager;
383 Ogre::Camera* mCamera;
384
386 Ogre::Vector3 mLastCameraPosition;
391
394
399
401 Ogre::Real mTimeMultiplier;
403 Ogre::Real mTimeOffset;
404
406 };
407}
408
409#endif
Config file manager.
Controller base class.
Definition Controller.h:34
const bool & isStarfieldEnabled() const
Is the starfield enable?
Definition SkyX.h:288
bool mVisible
Is SkyX visible?
Definition SkyX.h:393
Ogre::Real mTimeMultiplier
Time multiplier.
Definition SkyX.h:401
const Ogre::Real & getTimeMultiplier() const
Get time multiplier.
Definition SkyX.h:175
MoonManager * mMoonManager
Moon manager.
Definition SkyX.h:368
const bool isCreated() const
Is SkyX created?
Definition SkyX.h:143
Ogre::Camera * mCamera
Current rendering camera.
Definition SkyX.h:383
CfgFileManager * mCfgFileManager
Definition SkyX.h:405
const Ogre::Real & getInfiniteCameraFarClipDistance() const
Get infinite cmaera far clip distance.
Definition SkyX.h:307
Controller * mController
Controller.
Definition SkyX.h:375
void setTimeMultiplier(const Ogre::Real &TimeMultiplier)
Set time multiplier.
Definition SkyX.h:166
Ogre::SceneManager * getSceneManager()
Get scene manager.
Definition SkyX.h:315
AtmosphereManager * getAtmosphereManager()
Get atmosphere manager.
Definition SkyX.h:191
AtmosphereManager * mAtmosphereManager
Atmosphere manager.
Definition SkyX.h:364
bool mCreated
Is SkyX created?
Definition SkyX.h:359
VCloudsManager * getVCloudsManager()
Get volumetric clouds manager.
Definition SkyX.h:223
CloudsManager * getCloudsManager()
Get clouds manager.
Definition SkyX.h:215
MeshManager * getMeshManager()
Get mesh manager.
Definition SkyX.h:183
void setController(Controller *c)
Set controller.
Definition SkyX.h:231
const RenderQueueGroups & getRenderQueueGroups() const
Get render queue groups.
Definition SkyX.h:257
MoonManager * getMoonManager()
Get moon manager.
Definition SkyX.h:207
Ogre::Real mTimeOffset
Time offset.
Definition SkyX.h:403
LightingMode
Lighting mode enumeration SkyX is designed for true HDR rendering, but there is a big number of appli...
Definition SkyX.h:97
Ogre::SceneManager * mSceneManager
Scene manager.
Definition SkyX.h:381
const bool loadCfg(const Ogre::String &File) const
Definition SkyX.h:352
MeshManager * mMeshManager
Mesh manager.
Definition SkyX.h:362
VCloudsManager * mVCloudsManager
Volumetric clouds manager.
Definition SkyX.h:372
bool mStarfield
Enable starfield?
Definition SkyX.h:398
Ogre::Real mInfiniteCameraFarClipDistance
Infinite camera far clip distance.
Definition SkyX.h:390
GPUManager * mGPUManager
GPU manager.
Definition SkyX.h:366
const Ogre::Real & _getTimeOffset() const
Get time offset.
Definition SkyX.h:342
Ogre::Vector3 mLastCameraPosition
Last camera position.
Definition SkyX.h:386
CloudsManager * mCloudsManager
Clouds manager.
Definition SkyX.h:370
const LightingMode & getLightingMode() const
Get lighting mode.
Definition SkyX.h:275
RenderQueueGroups mRenderQueueGroups
Render queue groups.
Definition SkyX.h:378
GPUManager * getGPUManager()
Get GPU manager.
Definition SkyX.h:199
void setInfiniteCameraFarClipDistance(const Ogre::Real &d)
Set infinite camera far clip distance.
Definition SkyX.h:299
const bool & isVisible() const
Is SkyX visible?
Definition SkyX.h:156
LightingMode mLightingMode
Lighting mode.
Definition SkyX.h:396
Ogre::Camera * getCamera()
Get current rendering camera.
Definition SkyX.h:323
Ogre::Real mLastCameraFarClipDistance
Last camera far clip distance.
Definition SkyX.h:388
CfgFileManager * getCfgFileManager()
Definition SkyX.h:347
Controller * getController() const
Get current controller.
Definition SkyX.h:244
Render queue groups.
Definition SkyX.h:67
Ogre::uint8 vclouds
VClouds render queue group.
Definition SkyX.h:82
Ogre::uint8 skydome
Skydome render queue group (Note: Moon = skydome_render_queue+1)
Definition SkyX.h:80
Ogre::uint8 vcloudsLightningsOver
VClouds lightnings render queue group (when the camera is over the cloud field)
Definition SkyX.h:86
Ogre::uint8 vcloudsLightningsUnder
VClouds lightnings render queue group (when the camera is under the cloud field)
Definition SkyX.h:84
RenderQueueGroups(const Ogre::uint8 &s, const Ogre::uint8 &vc, const Ogre::uint8 &vclu, const Ogre::uint8 &vclo)
Constructor.
Definition SkyX.h:74