2 #include "app/Application.hpp"
3 #include "app/Assets.hpp"
4 #include "app/init.hpp"
5 #include "app/MasterState.hpp"
6 #include "creature/Creature.hpp"
7 #include "world/Planet.hpp"
8 #include "world/Set.hpp"
9 #include "world/Simulation.hpp"
10 #include "world/Sun.hpp"
11 #include "world/TileType.hpp"
17 using namespace blobs;
19 int main(int argc, char *argv[]) {
20 app::Init init(true, 8);
26 sun.SurfaceTilt(glm::dvec2(PI * 0.25, PI * 0.25));
27 sun.AngularMomentum(1.0e13);
29 world::Planet planet(25);
30 planet.SetParent(sun);
32 planet.GetOrbit().SemiMajorAxis(941.7);
33 planet.SurfaceTilt(glm::dvec2(PI * 0.25, PI * 0.25));
34 planet.AxialTilt(glm::dvec2(PI * 0.127, 0.0));
35 planet.AngularMomentum(6.0e10);
37 world::Planet moon(3);
38 moon.SetParent(planet);
40 moon.GetOrbit().SemiMajorAxis(37.0);
41 moon.Rotation(PI * 0.25);
42 moon.AngularMomentum(1.0e4);
44 world::Planet second_planet(9);
45 second_planet.SetParent(sun);
46 second_planet.Mass(1.0e9);
47 second_planet.GetOrbit().SemiMajorAxis(350.0);
48 second_planet.SurfaceTilt(glm::dvec2(PI * 0.125, PI * 0.25));
49 second_planet.AxialTilt(glm::dvec2(PI * 0.95, 0.0));
50 second_planet.AngularMomentum(1.0e8);
52 world::Simulation sim(sun);
54 sim.AddPlanet(planet);
55 sim.AddPlanet(second_planet);
58 world::GenerateEarthlike(assets.data.tiles, planet);
59 planet.Atmosphere(assets.data.resources["air"].id);
60 world::GenerateTest(assets.data.tiles, moon);
61 world::GenerateTest(assets.data.tiles, second_planet);
63 std::cout << "length of year: " << planet.OrbitalPeriod() << "s" << std::endl;
64 std::cout << "length of moon cycle: " << moon.OrbitalPeriod() << "s" << std::endl;
65 std::cout << "length of day: " << planet.RotationalPeriod() << "s" << std::endl;
66 std::cout << "days per year: " << (planet.OrbitalPeriod() / planet.RotationalPeriod()) << std::endl;
67 std::cout << "moon cycle in days: " << (moon.OrbitalPeriod() / planet.RotationalPeriod()) << std::endl;
68 std::cout << "moon cycles per year: " << (planet.OrbitalPeriod() / moon.OrbitalPeriod()) << std::endl;
70 auto blob = new creature::Creature;
71 Spawn(*blob, planet, assets);
75 app::MasterState state(assets, sim);
79 //.FirstPerson(0, glm::vec3(0.0f, 0.0f, 0.1f), glm::vec3(1.0f, -0.75f, 0.1f))
81 //.FirstPerson(3, glm::vec3(0.0f, 0.0f, 0.1f), glm::vec3(1.0f, -0.75f, 0.1f))
83 //.MapView(0, glm::vec3(0.0f, 0.0f, 60.0f), 0.0f)
84 // from afar, rotating
85 .Orbital(glm::vec3(-60.0f, 0.0f, 0.0f))
90 // .Orbital(glm::vec3(-500.0f, 500.0f, 500.0f))
92 state.GetCreaturePanel().Show(*blob);
94 app::Application app(init.window, init.viewport);
95 app.PushState(&state);