X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2Fworld.cpp;h=ef9311fbb79022e1f826593dcd3d791c15704f55;hb=348143f5e41a5692ed7c8deab200f3c62f4395a2;hp=87c85ae7ad413514b6f6958425e12beefa08f3d7;hpb=75398ab9230c15215e7a378a26d2d55de67b47f0;p=blobs.git diff --git a/src/world/world.cpp b/src/world/world.cpp index 87c85ae..ef9311f 100644 --- a/src/world/world.cpp +++ b/src/world/world.cpp @@ -26,9 +26,6 @@ #include #include -using blobs::G; -using blobs::PI_2p0; - using std::sin; using std::cos; using std::pow; @@ -104,7 +101,7 @@ double Body::GravitationalParameter() const noexcept { double Body::OrbitalPeriod() const noexcept { if (parent) { - return PI_2p0 * sqrt(pow(orbit.SemiMajorAxis(), 3) / (G * (parent->Mass() + Mass()))); + return PI * 2.0 * sqrt(pow(orbit.SemiMajorAxis(), 3) / (G * (parent->Mass() + Mass()))); } else { return 0.0; } @@ -114,7 +111,7 @@ double Body::RotationalPeriod() const noexcept { if (std::abs(angular) < std::numeric_limits::epsilon()) { return std::numeric_limits::infinity(); } else { - return PI_2p0 * Inertia() / angular; + return PI * 2.0 * Inertia() / angular; } } @@ -165,11 +162,11 @@ void Body::Tick(double dt) { void Body::Cache() noexcept { if (parent) { orbital = - orbit.Matrix(PI_2p0 * (GetSimulation().Time() / OrbitalPeriod())) + orbit.Matrix(PI * 2.0 * (GetSimulation().Time() / OrbitalPeriod())) * glm::eulerAngleXY(axis_tilt.x, axis_tilt.y); inverse_orbital = glm::eulerAngleYX(-axis_tilt.y, -axis_tilt.x) - * orbit.InverseMatrix(PI_2p0 * (GetSimulation().Time() / OrbitalPeriod())); + * orbit.InverseMatrix(PI * 2.0 * (GetSimulation().Time() / OrbitalPeriod())); } else { orbital = glm::eulerAngleXY(axis_tilt.x, axis_tilt.y); inverse_orbital = glm::eulerAngleYX(-axis_tilt.y, -axis_tilt.x);