~ubuntu-branches/ubuntu/precise/stellarium/precise

« back to all changes in this revision

Viewing changes to src/stel_atmosphere.h

  • Committer: Bazaar Package Importer
  • Author(s): Cédric Delfosse
  • Date: 2008-05-19 21:28:23 UTC
  • mfrom: (3.1.5 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080519212823-m5nfiuntxstxzxj7
Tags: 0.9.1-4
Add libxcursor-dev, libxfixes-dev, libxinerama-dev, libqt4-opengl-dev to
build-deps (Closes: #479906)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Stellarium
3
 
 * Copyright (C) 2003 Fabien Chereau
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or
6
 
 * modify it under the terms of the GNU General Public License
7
 
 * as published by the Free Software Foundation; either version 2
8
 
 * of the License, or (at your option) any later version.
9
 
 *
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU General Public License
16
 
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
 
 */
19
 
 
20
 
/*
21
 
        Class which compute and display the daylight sky color using openGL
22
 
        the sky is computed with the Skylight class.
23
 
*/
24
 
 
25
 
#ifndef _STEL_ATMOSTPHERE_H_
26
 
#define _STEL_ATMOSTPHERE_H_
27
 
 
28
 
#include "skylight.h"
29
 
#include "vecmath.h"
30
 
#include "navigator.h"
31
 
#include "tone_reproductor.h"
32
 
#include "skybright.h"
33
 
#include "fader.h"
34
 
 
35
 
using namespace std;
36
 
 
37
 
class Atmosphere
38
 
{
39
 
public:
40
 
    Atmosphere();
41
 
    virtual ~Atmosphere();
42
 
        void compute_color(double JD, Vec3d sunPos, Vec3d moonPos, float moon_phase, ToneReproductor * eye, Projector* prj,
43
 
                float latitude = 45.f, float altitude = 200.f,
44
 
                float temperature = 15.f, float relative_humidity = 40.f);
45
 
        void draw(Projector* prj, int delta_time);
46
 
        void update(int delta_time) {fader.update(delta_time);}
47
 
        
48
 
        //! Set fade in/out duration in seconds
49
 
        void setFadeDuration(float duration) {fader.set_duration((int)(duration*1000.f));}
50
 
        //! Get fade in/out duration in seconds
51
 
        float getFadeDuration() {return fader.get_duration()/1000.f;}
52
 
        
53
 
        //! Define whether to display atmosphere
54
 
        void setFlagShow(bool b){fader = b;}
55
 
        //! Get whether atmosphere is displayed
56
 
        bool getFlagShow() const {return fader;}
57
 
        
58
 
        float get_intensity(void) {return atm_intensity; }  // tells you actual atm intensity due to eclipses + fader
59
 
        float get_fade_intensity(void) {return fader.getInterstate();}  // let's you know how far faded in or out the atm is (0-1)
60
 
        float get_world_adaptation_luminance(void) const {return world_adaptation_luminance;}
61
 
        float get_milkyway_adaptation_luminance(void) const {return milkyway_adaptation_luminance;}
62
 
private:
63
 
        Skylight sky;
64
 
        Skybright skyb;
65
 
        int sky_resolution;
66
 
        Vec3f ** tab_sky;       // For Atmosphere calculation
67
 
        int startY;                     // intern variable used to store the Horizon Y screen value
68
 
        float world_adaptation_luminance;
69
 
        float milkyway_adaptation_luminance;
70
 
        float atm_intensity;
71
 
        ParabolicFader fader;
72
 
};
73
 
 
74
 
#endif // _STEL_ATMOSTPHERE_H_