]> git.localhorst.tv Git - blobs.git/blob - src/world/Orbit.hpp
randomize creature properties a bit
[blobs.git] / src / world / Orbit.hpp
1 #ifndef BLOBS_WORLD_ORBIT_HPP_
2 #define BLOBS_WORLD_ORBIT_HPP_
3
4 #include "../math/glm.hpp"
5
6
7 namespace blobs {
8 namespace world {
9
10 class Orbit {
11
12 public:
13         Orbit();
14         ~Orbit();
15
16 public:
17         double SemiMajorAxis() const noexcept;
18         Orbit &SemiMajorAxis(double) noexcept;
19
20         double Eccentricity() const noexcept;
21         Orbit &Eccentricity(double) noexcept;
22
23         double Inclination() const noexcept;
24         Orbit &Inclination(double) noexcept;
25
26         double LongitudeAscending() const noexcept;
27         Orbit &LongitudeAscending(double) noexcept;
28
29         double ArgumentPeriapsis() const noexcept;
30         Orbit &ArgumentPeriapsis(double) noexcept;
31
32         double MeanAnomaly() const noexcept;
33         Orbit &MeanAnomaly(double) noexcept;
34
35         /// calculate transformation matrix at position t in the
36         /// orbit, measured in degrees from mean anomaly at t=0
37         glm::dmat4 Matrix(double t) const noexcept;
38         glm::dmat4 InverseMatrix(double t) const noexcept;
39
40 private:
41         double sma; // semi-major axis
42         double ecc; // eccentricity
43         double inc; // inclination
44         double asc; // longitude of ascending node
45         double arg; // argument of periapsis
46         double mna; // mean anomaly (at t=0)
47
48 };
49
50 }
51 }
52
53 #endif