GlobeEngine
Star.h
Go to the documentation of this file.
1 #ifndef ExoViewer_Star_h
2 #define ExoViewer_Star_h
3 
4 #include "Body.h"
5 #include "PointLight.h"
6 
7 namespace geAstro{
8 
9  class Star : public ge::Sphere {
10 
11  public:
12  Star();
13  ~Star();
14  void clear();
15  void update(double _daysPerUpdate);
16  void createWithOverlay(BodyInfo _data, vmml::Vector3d _positionFromSystemCenter, std::string _spectraltype, double _scaleSize, double _metallicity, double _magV,
17  std::shared_ptr<ge::Shader> _programForSpheres, std::shared_ptr<ge::TextureHandle> _sunTex, std::shared_ptr<ge::TextureHandle> _sunOverlayTex);
18 
19  void draw(std::shared_ptr<ge::Camera> _cam);
20 
21  std::shared_ptr<ge::PointLight> getPointLightSource();
22  double getVisualMagnitude();
23  double getMetallicity();
24  std::string getSpectralType();
25  const std::shared_ptr<Body> getBody() const;
26 
27  void setSpectralType(const char* _spectralType);
28  void setOverlayTextureHandle(std::shared_ptr<ge::TextureHandle> _handleToOverlayTex);
29  void setSunTextureHandle(std::shared_ptr<ge::TextureHandle> _handleToSunTex);
30  void setGradientTextureHandle(std::shared_ptr<ge::TextureHandle> _handleToGradientTex);
31  void setAnimationStep(float _in);
32 
33  static vmml::Vector4f getColorVectorFromSpectralType(std::string spectraltype);
34 
35  private:
36  void createSphere(vmml::Vector3d _position, std::shared_ptr<ge::Shader> _programForSpheres, std::shared_ptr<ge::TextureHandle> _sunTex,
37  std::shared_ptr<ge::TextureHandle> _sunOverlayTex);
38 
39  std::shared_ptr<Body> starBody;
40  std::shared_ptr<ge::PointLight> pointLightSource; //this PointLight is not NULL for light emitting bodies.
41 
42  // Visual magnitude, details: https://en.wikipedia.org/wiki/Apparent_magnitude
43  double magV;
44  double metallicity;
45  double scaleSize;
46  std::string spectraltype;
47  // position unique in universe
48  vmml::Vector3d universePosition;
49  /*double magB;
50  double magR;
51  double magI;
52  double magJ;
53  double magH;
54  double magK;*/
55 
56  float animationStep;
57 
58  std::shared_ptr<ge::TextureHandle> overlaytexHandle;
59  std::shared_ptr<ge::TextureHandle> suntexHandle;
60  };
61 }
62 #endif
void createWithOverlay(BodyInfo _data, vmml::Vector3d _positionFromSystemCenter, std::string _spectraltype, double _scaleSize, double _metallicity, double _magV, std::shared_ptr< ge::Shader > _programForSpheres, std::shared_ptr< ge::TextureHandle > _sunTex, std::shared_ptr< ge::TextureHandle > _sunOverlayTex)
Definition: Star.cpp:26
void setSunTextureHandle(std::shared_ptr< ge::TextureHandle > _handleToSunTex)
Definition: Star.cpp:129
void setAnimationStep(float _in)
Definition: Star.cpp:133
double getVisualMagnitude()
Definition: Star.cpp:113
void setOverlayTextureHandle(std::shared_ptr< ge::TextureHandle > _handleToOverlayTex)
Definition: Star.cpp:124
Star()
Definition: Star.cpp:4
void draw(std::shared_ptr< ge::Camera > _cam)
Definition: Star.cpp:72
Definition: Sphere.h:18
void clear()
Definition: Star.cpp:13
Definition: AstroCommon.h:18
double getMetallicity()
Definition: Star.cpp:114
Definition: Star.h:9
void setSpectralType(const char *_spectralType)
~Star()
Definition: Star.cpp:9
std::shared_ptr< ge::PointLight > getPointLightSource()
Definition: Star.cpp:116
void setGradientTextureHandle(std::shared_ptr< ge::TextureHandle > _handleToGradientTex)
std::string getSpectralType()
Definition: Star.cpp:120
void update() override
Definition: Sphere.cpp:217
static vmml::Vector4f getColorVectorFromSpectralType(std::string spectraltype)
Definition: Star.cpp:143
const std::shared_ptr< Body > getBody() const
Definition: Star.cpp:137
Definition: Body.h:25