00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _ATMOSTPHERE_HPP_
00021 #define _ATMOSTPHERE_HPP_
00022
00023 #include "Skylight.hpp"
00024 #include "VecMath.hpp"
00025 #include "StelNavigator.hpp"
00026 #include "Skybright.hpp"
00027 #include "StelFader.hpp"
00028 #include "GLee.h"
00029 #include "fixx11h.h"
00030
00031 class StelProjector;
00032 class StelToneReproducer;
00033 class StelCore;
00034
00038 class Atmosphere
00039 {
00040 public:
00041 Atmosphere(void);
00042 virtual ~Atmosphere(void);
00043 void computeColor(double JD, Vec3d _sunPos, Vec3d moonPos, float moonPhase, StelCore* core,
00044 float latitude = 45.f, float altitude = 200.f,
00045 float temperature = 15.f, float relativeHumidity = 40.f);
00046 void draw(StelCore* core);
00047 void update(double deltaTime) {fader.update((int)(deltaTime*1000));}
00048
00050 void setFadeDuration(float duration) {fader.setDuration((int)(duration*1000.f));}
00052 float getFadeDuration() {return fader.getDuration()/1000.f;}
00053
00055 void setFlagShow(bool b){fader = b;}
00057 bool getFlagShow() const {return fader;}
00058
00061 float getRealDisplayIntensityFactor(void) const {return fader.getInterstate()*eclipseFactor;}
00062
00063
00064 float getFadeIntensity(void) const {return fader.getInterstate();}
00065
00070 float getAverageLuminance(void) const {return averageLuminance;}
00071
00073 void setLightPollutionLuminance(float f) { lightPollutionLuminance = f; }
00075 float getLightPollutionLuminance() const { return lightPollutionLuminance; }
00076
00077 private:
00078 Vec4i viewport;
00079 Skylight sky;
00080 Skybright skyb;
00081 int skyResolutionY,skyResolutionX;
00082
00083 Vec2f* posGrid;
00084 Vec3f* colorGrid;
00085 GLushort* indices;
00086
00088 float averageLuminance;
00089 double eclipseFactor;
00090 ParabolicFader fader;
00091 float lightPollutionLuminance;
00092
00093 unsigned int vertexBufferId;
00094 unsigned int indicesBufferId;
00095 };
00096
00097 #endif // _ATMOSTPHERE_HPP_