GlobeEngine
Moon.h
Go to the documentation of this file.
1 #ifndef ExoViewer_Moon_h
2 #define ExoViewer_Moon_h
3 
4 #include "Body.h"
5 
6 namespace geAstro{
7  struct MoonInfo
8  {
9  double volume; //volume in km^3
10  double density; //density in g/cm^3
11  double surfaceArea; //surface area in km^2
12  double surfaceGravity; //surface gravity in m/s^2
13 
15  volume = -1;
16  density = -1;
17  surfaceArea = -1;
18  surfaceGravity = -1;
19  }
20 
21  MoonInfo(double _volume, double _density, double _surfaceArea, double _surfaceGravity):
22  volume(_volume), density(_density), surfaceArea(_surfaceArea), surfaceGravity(_surfaceGravity)
23  {}
24  };
25 
26  class Moon : public ge::Sphere { //: public Body {
27 
28  public:
29  Moon();
30  ~Moon();
31  void clear();
32  void update();
33  void createMoon(MoonInfo _info, BodyInfo _bodyinfo, vmml::Vector3d _position,
34  std::shared_ptr<ge::Shader> _programForSpheres, std::shared_ptr<ge::Texture2Drgba> _tex, bool _hasCoreView);
35 
36  const MoonInfo& getInfo() const;
37  void drawOrbit(std::shared_ptr<ge::Camera> _cam);
38  bool hasOrbit() const;
39 
40  void setParent(std::shared_ptr<Body> _parent);
41  const std::shared_ptr<Body> getBody() const;
42 
43  private:
44  MoonInfo info;
45  std::shared_ptr<Body> moonBody;
46  std::shared_ptr<ge::Texture2Drgba> moontex;
47  };
48 }
49 #endif
void drawOrbit(std::shared_ptr< ge::Camera > _cam)
Definition: Moon.cpp:54
double surfaceGravity
Definition: Moon.h:12
bool hasOrbit() const
const std::shared_ptr< Body > getBody() const
Definition: Moon.cpp:62
Definition: Sphere.h:18
void update()
Definition: Moon.cpp:49
MoonInfo(double _volume, double _density, double _surfaceArea, double _surfaceGravity)
Definition: Moon.h:21
Definition: AstroCommon.h:18
~Moon()
Definition: Moon.cpp:10
Definition: Moon.h:7
void clear()
Definition: Moon.cpp:14
double volume
Definition: Moon.h:9
const MoonInfo & getInfo() const
Definition: Moon.cpp:45
Moon()
Definition: Moon.cpp:5
MoonInfo()
Definition: Moon.h:14
void createMoon(MoonInfo _info, BodyInfo _bodyinfo, vmml::Vector3d _position, std::shared_ptr< ge::Shader > _programForSpheres, std::shared_ptr< ge::Texture2Drgba > _tex, bool _hasCoreView)
Definition: Moon.cpp:19
double density
Definition: Moon.h:10
void setParent(std::shared_ptr< Body > _parent)
Definition: Moon.cpp:58
Definition: Moon.h:26
double surfaceArea
Definition: Moon.h:11
Definition: Body.h:25