GlobeEngine
AtmosphereShell.h
Go to the documentation of this file.
1 #ifndef AtmosphereEngine_AtmosphereShell_h
2 #define AtmosphereEngine_AtmosphereShell_h
3 #include "Sun.h"
5 #include "Camera.h"
6 
7 namespace at {
8  class AtmosphereShell : public ge::Sphere
9  {
10  public:
13 
14  void setRadiuses(double _innerRadius, double _outerRadius, double _planetRadius, double _scaling, int _shellOrder);
15  void setRadiuses(double _innerRadius, double _outerRadius, double _planetRadius);
16  void updateCameraPosition(vmml::Vector3f _pos);
17 
18  void setSunsOnScreen(GLfloat* _vec);
19 
20  void setSunEnvironment(std::vector<at::Sun*> _sunVec);
21  void setAtmosphereEnvironment(std::vector< std::shared_ptr<at::AtmosphereShell> > _atVec);
22  double getInnerRadius();
23  double getOuterRadius();
24  double getPlanetRadius();
25 
26  void setLightIntensity(double origin_, double min_);
27 
28  void enable();
29  void disable();
30  bool isEnabled();
31 
32  std::string getChemicalCompounds();
33  void setChemicalCompounds(std::string cStr_);
34 
35  void setComposition(std::shared_ptr<at::AtmosphereComposition> a);
36  std::shared_ptr<at::AtmosphereComposition> getComposition();
37  void updateRenderingMode(int i_);
38 
39  void draw(std::shared_ptr<ge::Camera> _cam);
40  void setShader(std::shared_ptr<ge::Shader> _shader);
41  void setPosition(vmml::Vector3f _pos);
42 
43  private:
44  float lightIntensity;
45  float lightIntensityMin;
46  bool enabled;
47  void updateUniforms();
48  void updateEnvironments();
49 
50  int renderingMode;
51  int shellOrder;
52  double innerRadius;
53  double outerRadius;
54  double planetRadius;
55  double universeScaling;
56  vmml::Vector3f camPosition;
57  vmml::Vector2f camViewport;
58 
59  std::vector<at::Sun*> sunEnvironment;
60  std::vector<std::shared_ptr<at::AtmosphereShell> > atmosphereEnvironment;
61 
62  std::shared_ptr<at::AtmosphereComposition> composition;
63 
64  GLfloat* sunPositions;
65  GLfloat* sunRadiuses;
66  GLfloat* atmosphereRadiuses;
67  GLfloat* atmosphereDensities;
68  GLfloat* atmosphereRefractiveIndexes;
69  GLfloat* sunScreenPositions;
70 
71  GLint uniformSunCount;
72  GLint uniformSunLocations;
73  GLint uniformSunRadiuses;
74  GLint uniformSunScreenLocations;
75 
76  GLint uniformAtmosphereShellCount; //Number of active Atmosphere-Shells
77  GLint uniformShellOrder; //current Atmosphere-Shell number
78  GLint uniformPrecomputedExtinction;
79  GLint uniformAtmosphereRadiuses;
80  GLint uniformAtmosphereDensities;
81  GLint uniformAtmosphereRefractiveIndexes;
82 
83  GLint uniformScalingFactor;
84 
85  GLint uniformRayleighMieRelation;
86 
87  GLint uniformLightIntensity;
88  GLint uniformLightIntensityMin;
89 
90  GLint uniformRenderingMode;
91 
92  GLint uniformAtmosphereCenter;
93  GLint uniformInnerRadius;
94  GLint uniformOuterRadius;
95  GLint uniformPlanetRadius;
96 
97  GLint uniformCamLocation;
98  GLint uniformCamViewport;
99 
100  GLint uniformNumberDensity;
101  GLint uniformRefractiveIndex;
102  GLint uniformAtmosphereColorComponent;
103  };
104 }
105 #endif
106 
void setSunsOnScreen(GLfloat *_vec)
Definition: AtmosphereShell.cpp:32
std::string getChemicalCompounds()
Definition: AtmosphereShell.cpp:241
double getPlanetRadius()
Definition: AtmosphereShell.cpp:74
void draw(std::shared_ptr< ge::Camera > _cam)
Definition: AtmosphereShell.cpp:26
void setLightIntensity(double origin_, double min_)
Definition: AtmosphereShell.cpp:260
AtmosphereShell()
Definition: AtmosphereShell.cpp:11
void setRadiuses(double _innerRadius, double _outerRadius, double _planetRadius, double _scaling, int _shellOrder)
Definition: AtmosphereShell.cpp:36
Definition: AtmosphereShell.h:8
Definition: Sphere.h:18
void enable()
Definition: AtmosphereShell.cpp:248
void setSunEnvironment(std::vector< at::Sun * > _sunVec)
Definition: AtmosphereShell.cpp:56
double getInnerRadius()
Definition: AtmosphereShell.cpp:66
~AtmosphereShell()
Definition: AtmosphereShell.cpp:23
void setPosition(vmml::Vector3f _pos)
Definition: AtmosphereShell.cpp:118
void disable()
Definition: AtmosphereShell.cpp:252
void setChemicalCompounds(std::string cStr_)
Definition: AtmosphereShell.cpp:244
void updateCameraPosition(vmml::Vector3f _pos)
Definition: AtmosphereShell.cpp:52
double getOuterRadius()
Definition: AtmosphereShell.cpp:70
Definition: AtmosphereComposition.h:20
std::shared_ptr< at::AtmosphereComposition > getComposition()
Definition: AtmosphereShell.cpp:233
void setComposition(std::shared_ptr< at::AtmosphereComposition > a)
Definition: AtmosphereShell.cpp:229
void updateRenderingMode(int i_)
Definition: AtmosphereShell.cpp:237
void setAtmosphereEnvironment(std::vector< std::shared_ptr< at::AtmosphereShell > > _atVec)
Definition: AtmosphereShell.cpp:61
void setShader(std::shared_ptr< ge::Shader > _shader)
Definition: AtmosphereShell.cpp:78
bool isEnabled()
Definition: AtmosphereShell.cpp:256