Pioneer
Planet.h
Go to the documentation of this file.
1 // Copyright © 2008-2021 Pioneer Developers. See AUTHORS.txt for details
2 // Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
3 
4 #ifndef _PLANET_H
5 #define _PLANET_H
6 
7 #include "SmartPtr.h"
8 #include "TerrainBody.h"
9 #include "graphics/VertexArray.h"
10 
11 namespace Graphics {
12  class Renderer;
13  class RenderState;
14  class Texture;
15  class Material;
16 } // namespace Graphics
17 
18 class Planet : public TerrainBody {
19 public:
21  Planet() = delete;
22  Planet(SystemBody *);
23  Planet(const Json &jsonObj, Space *space);
24 
25  virtual void SubRender(Graphics::Renderer *r, const matrix4x4d &viewTran, const vector3d &camPos) override;
26 
27  void GetAtmosphericState(double dist, double *outPressure, double *outDensity) const;
28  double GetAtmosphereRadius() const { return m_atmosphereRadius; }
29 
30  friend class ObjectViewerView;
31 
32 protected:
33 private:
34  void InitParams(const SystemBody *);
35  void GenerateRings(Graphics::Renderer *renderer);
36  void DrawGasGiantRings(Graphics::Renderer *r, const matrix4x4d &modelView);
37 
38  double m_atmosphereRadius;
39  double m_surfaceGravity_g;
41  Graphics::VertexArray m_ringVertices;
42  std::unique_ptr<Graphics::Material> m_ringMaterial;
43  Graphics::RenderState *m_ringState;
44 
45  // Legacy renderer visuals
46  std::unique_ptr<Graphics::VertexArray> m_atmosphereVertices;
47  std::unique_ptr<Graphics::Material> m_atmosphereMaterial;
48 };
49 
50 #endif /* _PLANET_H */
nlohmann::json Json
Definition: Json.h:8
Definition: RenderState.h:25
Definition: Renderer.h:39
Definition: VertexArray.h:19
Definition: ObjectViewerView.h:15
Definition: Planet.h:18
double GetAtmosphereRadius() const
Definition: Planet.h:28
OBJDEF(Planet, TerrainBody, PLANET)
virtual void SubRender(Graphics::Renderer *r, const matrix4x4d &viewTran, const vector3d &camPos) override
Definition: Planet.cpp:263
void GetAtmosphericState(double dist, double *outPressure, double *outDensity) const
Definition: Planet.cpp:98
Planet()=delete
Definition: Space.h:19
Definition: SystemBody.h:19
Definition: TerrainBody.h:21
Definition: Background.h:13