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
AtmosphereManager.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_AtmosphereManager_H_
25#define _SkyX_AtmosphereManager_H_
26
27#include "Prerequisites.h"
28
29namespace SkyX
30{
31 class SkyX;
32
34 {
35 public:
36
39 struct Options
40 {
42 Ogre::Real InnerRadius;
44 Ogre::Real OuterRadius;
46 Ogre::Real HeightPosition;
47
51 Ogre::Real MieMultiplier;
53 Ogre::Real SunIntensity;
54
56 Ogre::Vector3 WaveLength;
57
59 Ogre::Real G;
60
62 Ogre::Real Exposure;
63
66
70 : InnerRadius(9.77501f)
71 , OuterRadius(10.2963f)
72 , HeightPosition(0.01f)
73 , RayleighMultiplier(0.0022f)
74 , MieMultiplier(0.000675f)
75 , SunIntensity(30)
76 , WaveLength(Ogre::Vector3(0.57f, 0.54f, 0.44f))
77 , G(-0.991f)
78 , Exposure(2.0f)
80 {
81 }
82
95 Options(const Ogre::Real& _InnerRadius,
96 const Ogre::Real& _OuterRadius,
97 const Ogre::Real& _HeightPosition,
98 const Ogre::Real& _RayleighMultiplier,
99 const Ogre::Real& _MieMultiplier,
100 const Ogre::Real& _SunIntensity,
101 const Ogre::Vector3& _WaveLength,
102 const Ogre::Real& _G,
103 const Ogre::Real& _Exposure,
104 const int& _NumerOfSamples)
105 : InnerRadius(_InnerRadius)
106 , OuterRadius(_OuterRadius)
107 , HeightPosition(_HeightPosition)
108 , RayleighMultiplier(_RayleighMultiplier)
109 , MieMultiplier(_MieMultiplier)
110 , SunIntensity(_SunIntensity)
111 , WaveLength(_WaveLength)
112 , G(_G)
113 , Exposure(_Exposure)
114 , NumberOfSamples(_NumerOfSamples)
115 {
116 }
117 };
118
123
127
131 inline void setOptions(const Options& _Options)
132 {
133 _update(_Options);
134 }
135
139 inline const Options& getOptions() const
140 {
141 return mOptions;
142 }
143
148 const Ogre::Vector3 getColorAt(const Ogre::Vector3& Direction) const;
149
155 void _update(const Options& NewOptions, const bool& ForceToUpdateAll = false);
156
157 private:
163 const float _scale(const float& cos, const float& uScaleDepth) const;
164
167
170 };
171}
172
173#endif
const Options & getOptions() const
Get current options.
const float _scale(const float &cos, const float &uScaleDepth) const
Shader scale funtion.
void _update(const Options &NewOptions, const bool &ForceToUpdateAll=false)
Update atmoshpere.
const Ogre::Vector3 getColorAt(const Ogre::Vector3 &Direction) const
Get current atmosphere color at the given direction.
SkyX * mSkyX
SkyX parent pointer.
void setOptions(const Options &_Options)
Set options.
Options mOptions
Our options.
Ogre::Real Exposure
Exposure coeficient.
Ogre::Real G
Phase function.
Ogre::Real HeightPosition
Height position, in [0, 1] range, 0=InnerRadius, 1=OuterRadius.
Ogre::Real SunIntensity
Sun intensity.
Ogre::Real OuterRadius
Outer atmosphere radius.
Ogre::Vector3 WaveLength
WaveLength for RGB channels.
Options(const Ogre::Real &_InnerRadius, const Ogre::Real &_OuterRadius, const Ogre::Real &_HeightPosition, const Ogre::Real &_RayleighMultiplier, const Ogre::Real &_MieMultiplier, const Ogre::Real &_SunIntensity, const Ogre::Vector3 &_WaveLength, const Ogre::Real &_G, const Ogre::Real &_Exposure, const int &_NumerOfSamples)
Constructor.
Ogre::Real MieMultiplier
Mie multiplier.
Ogre::Real InnerRadius
Inner atmosphere radius.
Ogre::Real RayleighMultiplier
Rayleigh multiplier.
int NumberOfSamples
Number of samples.