1 #include "Simulation.hpp"
11 Simulation::Simulation(Body &r)
20 Simulation::~Simulation() {
24 void Simulation::AddBody(Body &b) {
25 b.SetSimulation(*this);
29 void Simulation::AddPlanet(Planet &p) {
34 void Simulation::AddSun(Sun &s) {
39 void Simulation::Tick() {
40 constexpr double dt = 0.01666666666666666666666666666666;
42 for (auto body : bodies) {
43 body->Rotation(body->Rotation() + dt * body->AngularMomentum() / body->Inertia());