GlobeEngine
AtmosphereEngine.h
Go to the documentation of this file.
1 
8 #ifndef AtmosphereEngine_AtmosphereEngine_h
9 #define AtmosphereEngine_AtmosphereEngine_h
10 
11 #include <math.h>
12 #include <ctime>
13 #include <iostream>
14 #include <stdio.h>
15 #include <vector>
16 #include "OpenGL_Includes.h"
17 #include "Engine.h"
18 #include "Shader.h"
19 #include "FlightCamera.h"
20 #include "ArcBallCamera.h"
21 #include "CollisionCamera.h"
22 #include "Common.h"
23 #include "CoordinateSystem.h"
24 #include "SceneStateSet.h"
25 #include "Cube.h"
26 #include "DrawableComponent.h"
27 #include "Plane.h"
28 #include "DebugLogger.h"
29 #include "Timer.h"
30 #include "MemoryState.h"
31 #include "DebugMap.h"
32 #include "Sphere.h"
33 #include "AtmosphereShell.h"
34 #include "AtmosphereComposition.h"
35 #include "Planet.h"
36 #include "Sun.h"
37 
38 namespace at {
40  {
41  public:
44 
45  void clear();
46  void destroy();
47  void create(bool _fullload);
48  void create();
49 
50  void initializeScene(std::string _projectsrcPath = 0);
51  void drawScene();
52  void resize(int _w, int _h);
53  void update();
54 
55  vmml::Vector3f calculateCyclePosition(vmml::Vector3f _position);
56  void moveCam(vmml::Vector3f _movement);
58 
59  void interpretTristate(int s1_, int s2_, int s3_);
60  bool setSpectrum(int lowRed_, int highRed_, int lowGreen_, int highGreen_, int lowBlue_, int highBlue_);
61  bool addLayer(int innerRadius_, int outerRadius_, double density_, bool earthDensity_);
62  double getRadius();
63  double getDensity();
64  std::string getChemical();
65  int changeLayerUpwards();
67  void deleteLayer();
68  int enableDisableLayer(bool change_);
69  void setDensity(double density_);
70  void setChemical(std::string chemical_);
71  void changeLayerVisual(bool b);
72  void resetCamera();
73 
74  std::string getAtmosphereInfo();
75 
76  private:
77  bool fullload;
78  std::shared_ptr<ge::Shader> shaderForUtilities;
79  std::shared_ptr<ge::Shader> shaderForCubes;
80  std::shared_ptr<ge::Shader> shaderForPlanes;
81  std::shared_ptr<ge::Shader> shaderForPlanets;
82  std::shared_ptr<ge::Shader> shaderForNightPlanets;
83  std::shared_ptr<ge::Shader> shaderForDebug;
84  std::shared_ptr<ge::Shader> shaderForAtmospheres;
85  std::shared_ptr<ge::Shader> shaderForSuns;
86  std::shared_ptr<ge::Shader> shaderForStellar;
87 
88  // CoordinateCross
89  ge::CoordinateSystem coordinateSystem;
90  // Basic scene state
91  ge::SceneStateSet sceneStates[1];
92 
93  std::shared_ptr<at::AtmosphereShell> tropoSphere;
94  std::shared_ptr<at::AtmosphereShell> stratoSphere;
95  std::shared_ptr<at::AtmosphereShell> mesoSphere;
96  std::shared_ptr<at::AtmosphereShell> thermoSphere;
97  std::shared_ptr<at::AtmosphereShell> exoSphere;
98  at::Planet* planet;
99 
100  vmml::Vector3f camOffset;
101 
102  ge::Sphere* stellarBackground;
103  bool renderStellar;
104 
105  float scaleAdjustment;
106  float rotationalSpeed;
107  float dayOfTheYear;
108  float rotationAmount;
109 
110  GLint uniformLowRed;
111  int lowRed;
112  GLint uniformHighRed;
113  int highRed;
114  GLint uniformLowGreen;
115  int lowGreen;
116  GLint uniformHighGreen;
117  int highGreen;
118  GLint uniformLowBlue;
119  int lowBlue;
120  GLint uniformHighBlue;
121  int highBlue;
122 
123  GLint uniformSelectedLayer;
124  int selectedAtmosphereLayer;
125  bool selectedLayerVisible;
126 
127  // Debugger functionality
128  geUtil::DebugLogger openglDebugLogger;
129  ge::Timer openglTimer;
130  geUtil::MemoryState openglMemory;
131  geUtil::DebugMap debugmap;
132 
133  std::vector<at::Sun*> sunEnvironment;
134  std::vector< std::shared_ptr<at::AtmosphereShell> > atmosphereEnvironment;
135 
136  std::string projectSourcePath;
137 
138  std::shared_ptr<ge::Texture2Drgba> whitetex;
139  std::shared_ptr<ge::Texture2Drgba> stellartex;
140 
141  };
142 }
143 #endif
int changeLayerDownwards()
Definition: AtmosphereEngine.cpp:503
std::string getChemical()
Definition: AtmosphereEngine.cpp:474
AtmosphereEngine()
Definition: AtmosphereEngine.cpp:11
Definition: MemoryState.h:16
void create()
Definition: AtmosphereEngine.cpp:63
void drawScene()
Definition: AtmosphereEngine.cpp:264
Definition: DebugMap.h:18
Definition: DebugLogger.h:22
void resetCamera()
Definition: AtmosphereEngine.cpp:586
Definition: Sphere.h:18
std::string getAtmosphereInfo()
Definition: AtmosphereEngine.cpp:571
bool addLayer(int innerRadius_, int outerRadius_, double density_, bool earthDensity_)
Definition: AtmosphereEngine.cpp:451
double getRadius()
Definition: AtmosphereEngine.cpp:460
void updateAtmosphereShader()
Definition: AtmosphereEngine.cpp:368
Definition: Engine.h:20
void moveCam(vmml::Vector3f _movement)
Definition: AtmosphereEngine.cpp:364
void resize(int _w, int _h)
Definition: AtmosphereEngine.cpp:345
void update()
Definition: AtmosphereEngine.cpp:260
void setChemical(std::string chemical_)
Definition: AtmosphereEngine.cpp:564
double getDensity()
Definition: AtmosphereEngine.cpp:467
Definition: AtmosphereEngine.h:39
vmml::Vector3f calculateCyclePosition(vmml::Vector3f _position)
Definition: AtmosphereEngine.cpp:351
Definition: AtmosphereComposition.h:20
Definition: SceneStateSet.h:41
void setDensity(double density_)
Definition: AtmosphereEngine.cpp:557
int enableDisableLayer(bool change_)
Definition: AtmosphereEngine.cpp:535
void deleteLayer()
Definition: AtmosphereEngine.cpp:527
~AtmosphereEngine()
Definition: AtmosphereEngine.cpp:30
Definition: Planet.h:18
bool setSpectrum(int lowRed_, int highRed_, int lowGreen_, int highGreen_, int lowBlue_, int highBlue_)
Definition: AtmosphereEngine.cpp:436
void destroy()
Definition: AtmosphereEngine.cpp:53
Definition: Timer.h:17
Definition: CoordinateSystem.h:17
void clear()
Definition: AtmosphereEngine.cpp:36
void changeLayerVisual(bool b)
Definition: AtmosphereEngine.cpp:522
void interpretTristate(int s1_, int s2_, int s3_)
Definition: AtmosphereEngine.cpp:396
int changeLayerUpwards()
Definition: AtmosphereEngine.cpp:483
void initializeScene(std::string _projectsrcPath=0)
Definition: AtmosphereEngine.cpp:68