diff options
author | Joursoir <chat@joursoir.net> | 2021-04-06 09:47:23 +0000 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2021-04-06 09:47:23 +0000 |
commit | 386504218362232385c61eca6365b95776c60c62 (patch) | |
tree | de9173f6d25c2830e971b0d4cdb71834cfa3c81b /src/game/CelestialObject.hpp | |
parent | 52307df6461880423169e4deecd2c3e2f54509bb (diff) | |
download | space-simulator-386504218362232385c61eca6365b95776c60c62.tar.gz space-simulator-386504218362232385c61eca6365b95776c60c62.tar.bz2 space-simulator-386504218362232385c61eca6365b95776c60c62.zip |
add routines for create celestial objects
Diffstat (limited to 'src/game/CelestialObject.hpp')
-rw-r--r-- | src/game/CelestialObject.hpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/game/CelestialObject.hpp b/src/game/CelestialObject.hpp new file mode 100644 index 0000000..8997697 --- /dev/null +++ b/src/game/CelestialObject.hpp @@ -0,0 +1,43 @@ +#ifndef ENGINE_CELESTIAL_OBJECT_H +#define ENGINE_CELESTIAL_OBJECT_H + +#include <glm/glm.hpp> + +class Texture; +class Mesh; + +class CelestialObject { + Texture *texture; + + static Mesh *sphere; + static Mesh *circle; + + /* time a given astronomical object takes to complete + one orbit around another object */ + float orbital_period; + float orbital_speed; + float orbital_radius; + glm::vec3 orbital_pos; + + /* time that the objects takes to complete a single revolution + around its axis of rotation relative to the background stars */ + float rotation_period; + float rotation_speed; + + float object_radius; + + float tilt_angle; +public: + CelestialObject(Texture *t) + : texture(t) { } + static void InitializeMesh(); + void SetPeriod(float a_orbital, float a_rotation); + void SetRadius(float object_r, float orbital_r); + void SetTilt(float angle); + void SetPosition(glm::vec3 orbital); + + void Draw(float time, float game_speed, unsigned int model_loc); + +}; + +#endif /* ENGINE_CELESTIAL_OBJECT_H */ |