2 #include "app/Application.hpp"
3 #include "app/Assets.hpp"
4 #include "app/init.hpp"
5 #include "app/MasterState.hpp"
6 #include "world/Planet.hpp"
7 #include "world/Simulation.hpp"
8 #include "world/Sun.hpp"
14 using namespace blobs;
16 int main(int argc, char *argv[]) {
17 app::Init init(true, 8);
23 sun.SurfaceTilt(glm::dvec2(PI * 0.25, PI * 0.25));
24 sun.AngularMomentum(1.0e9);
26 world::Planet planet(11);
27 world::GenerateTest(planet);
28 planet.SetParent(sun);
30 planet.GetOrbit().SemiMajorAxis(941.7);
31 planet.SurfaceTilt(glm::dvec2(PI * 0.25, PI * 0.25));
32 planet.AxialTilt(glm::dvec2(PI * 0.127, 0.0));
33 planet.AngularMomentum(1.25e9);
35 world::Planet moon(3);
36 world::GenerateTest(moon);
37 moon.SetParent(planet);
39 moon.GetOrbit().SemiMajorAxis(25.0);
40 moon.Rotation(PI * 0.25);
41 moon.AngularMomentum(1.0e4);
43 world::Simulation sim(sun);
45 sim.AddPlanet(planet);
48 std::cout << "length of year: " << planet.OrbitalPeriod() << "s" << std::endl;
49 std::cout << "length of moon cycle: " << moon.OrbitalPeriod() << "s" << std::endl;
50 std::cout << "length of day: " << planet.RotationalPeriod() << "s" << std::endl;
51 std::cout << "days per year: " << (planet.OrbitalPeriod() / planet.RotationalPeriod()) << std::endl;
52 std::cout << "moon cycle in days: " << (moon.OrbitalPeriod() / planet.RotationalPeriod()) << std::endl;
53 std::cout << "moon cycles per year: " << (planet.OrbitalPeriod() / moon.OrbitalPeriod()) << std::endl;
55 app::MasterState state(assets, sim);
59 .FirstPerson(0, glm::vec3(0.0f, 0.0f, 0.1f), glm::vec3(1.0f, -0.75f, 0.1f))
61 //.FirstPerson(3, glm::vec3(0.0f, 0.0f, 0.1f), glm::vec3(1.0f, -0.75f, 0.1f))
63 //.MapView(0, glm::vec3(0.0f, 0.0f, 25.0f), 0.0f)
65 //.Orbital(glm::vec3(50.0f, 2500.0f, 50.0f));
69 app::Application app(init.window, init.viewport);
70 app.PushState(&state);