]> git.localhorst.tv Git - blobs.git/blobdiff - src/world/sim.cpp
camera controls
[blobs.git] / src / world / sim.cpp
index 185046d4cfc4eed8e73270513c7568e3a55a9561..8c3749f347bff8963783cb2f322c60f22da37683 100644 (file)
@@ -8,8 +8,9 @@
 namespace blobs {
 namespace world {
 
-Simulation::Simulation(Body &r)
+Simulation::Simulation(Body &r, app::Assets &assets)
 : root(r)
+, assets(assets)
 , bodies()
 , planets()
 , suns()
@@ -36,11 +37,10 @@ void Simulation::AddSun(Sun &s) {
        suns.insert(&s);
 }
 
-void Simulation::Tick() {
-       constexpr double dt = 0.01666666666666666666666666666666;
+void Simulation::Tick(double dt) {
        time += dt;
        for (auto body : bodies) {
-               body->Rotation(body->Rotation() + dt * body->AngularMomentum() / body->Inertia());
+               body->Tick(dt);
        }
 }