Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure

modules/Atmosphere.hpp

00001 /*
00002  * Stellarium
00003  * Copyright (C) 2003 Fabien Chereau
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
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     // let's you know how far faded in or out the atm is (0-1)
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_

Generated on Mon Mar 9 16:16:16 2009 for Stellarium by  doxygen 1.5.5