Browse Source

add TODO items and testing for time_step

main
cinnaboot 4 years ago
parent
commit
7a0840fd93
  1. 29
      src/main.cpp

29
src/main.cpp

@ -1,4 +1,19 @@
/*
* TODO:
* - fix time_step and our postFrameCallback() to use time since last frame
* currently, the time step is incorrectly using 60Hz = 1s
* need to use a 'sim_timer' or something so we can track the satellite
* posistions correctly
* - add time to apoapsis/periapsis to satellite properties
* - use consistant name style for structs) 'UpperCase'
* - make an 'overlay' graphic for things like apoapsis, perisapsis, f1, f2,
* flight path
* - impulsive orbital maneuvers
* - Hohmman transfer orbits
* - patched conic method for transferring between 2 grav bodies
*/
#include <cassert> #include <cassert>
#include <cmath> #include <cmath>
@ -229,14 +244,14 @@ postFrameCallback(RenderState* rs, void* user_data = nullptr)
//updateOrbit(gs->system, ellipse_entity); //updateOrbit(gs->system, ellipse_entity);
} }
if (satellite == nullptr) { // FIXME: testing sim time
RenderGroup* rg = getRenderGroupByName(rs, "manual mesh group"); u64 ticks = SDL_GetTicks64();
satellite = getEntityByName(rg, "ship 01"); static u32 last_T;
} u32 T = ticks / 1000;
assert(satellite); if (T != last_T) {
updateSatelliteEntity(satellite, g_sys.sat); LOGF(Debug, "seconds since sim start: %d\n", T);
//updateOrbit(g_sys, ellipse_entity); last_T = T;
} }
} }

Loading…
Cancel
Save