sun.Radius(200.0);
sun.Color(glm::dvec3(1.0));
sun.Luminosity(1.0e8);
- sun.SurfaceTilt(glm::dvec2(PI * 0.25, PI * 0.25));
+ sun.AxialTilt(glm::dvec2(PI * 0.25, PI * 0.25));
sun.AngularMomentum(1.0e18);
world::Planet planet(25);
planet.SetParent(sun);
planet.Mass(1.0e13);
planet.GetOrbit().SemiMajorAxis(8184.0);
- planet.SurfaceTilt(glm::dvec2(PI * 0.25, PI * 0.25));
planet.AxialTilt(glm::dvec2(PI * 0.127, 0.0));
planet.AngularMomentum(6.5e13);
second_planet.SetParent(sun);
second_planet.Mass(1.0e12);
second_planet.GetOrbit().SemiMajorAxis(4350.0);
- second_planet.SurfaceTilt(glm::dvec2(PI * 0.125, PI * 0.25));
second_planet.AxialTilt(glm::dvec2(PI * 0.95, 0.0));
second_planet.AngularMomentum(1.0e12);
Orbit &GetOrbit() noexcept { return orbit; }
const Orbit &GetOrbit() const noexcept { return orbit; }
- const glm::dvec2 &SurfaceTilt() const noexcept { return surface_tilt; }
- void SurfaceTilt(const glm::dvec2 &t) noexcept { surface_tilt = t; }
-
const glm::dvec2 &AxialTilt() const noexcept { return axis_tilt; }
void AxialTilt(const glm::dvec2 &t) noexcept { axis_tilt = t; }
double mass;
double radius;
Orbit orbit;
- glm::dvec2 surface_tilt;
glm::dvec2 axis_tilt;
double rotation;
double angular;
, mass(1.0)
, radius(1.0)
, orbit()
-, surface_tilt(0.0, 0.0)
, axis_tilt(0.0, 0.0)
, rotation(0.0)
, angular(0.0)
orbital = glm::eulerAngleXY(axis_tilt.x, axis_tilt.y);
inverse_orbital = glm::eulerAngleYX(-axis_tilt.y, -axis_tilt.x);
}
- local =
- glm::eulerAngleY(rotation)
- * glm::eulerAngleXY(surface_tilt.x, surface_tilt.y);
- inverse_local =
- glm::eulerAngleYX(-surface_tilt.y, -surface_tilt.x)
- * glm::eulerAngleY(-rotation);
+ local = glm::eulerAngleY(rotation);
+ inverse_local = glm::eulerAngleY(-rotation);
}
void Body::CheckCollision() noexcept {
constexpr double highland_thresh = 0.4;
constexpr double mountain_thresh = 0.5;
- const glm::dvec3 axis(glm::dvec4(0.0, 1.0, 0.0, 0.0) * glm::eulerAngleXY(p.SurfaceTilt().x, p.SurfaceTilt().y));
+ const glm::dvec3 axis(0.0, 1.0, 0.0);
const double cap_thresh = std::abs(std::cos(p.AxialTilt().x));
const double equ_thresh = std::abs(std::sin(p.AxialTilt().x)) / 2.0;
const double fzone_start = equ_thresh - (equ_thresh - cap_thresh) / 3.0;