X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2Fsim.cpp;h=8c3749f347bff8963783cb2f322c60f22da37683;hb=dd8b3145a03ed676b0ae6311c29fc3d68f666b15;hp=8b4c2140c2ba96b672c9dd08ac7987223b52c9f9;hpb=98770f59a02c76f02de0a46ed36d9cfd52f5071b;p=blobs.git diff --git a/src/world/sim.cpp b/src/world/sim.cpp index 8b4c214..8c3749f 100644 --- a/src/world/sim.cpp +++ b/src/world/sim.cpp @@ -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,12 +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->Cache(); + body->Tick(dt); } }