|
|
|
|
@ -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 <cmath> |
|
|
|
|
|
|
|
|
|
@ -229,14 +244,14 @@ postFrameCallback(RenderState* rs, void* user_data = nullptr)
|
|
|
|
|
//updateOrbit(gs->system, ellipse_entity);
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (satellite == nullptr) { |
|
|
|
|
RenderGroup* rg = getRenderGroupByName(rs, "manual mesh group"); |
|
|
|
|
satellite = getEntityByName(rg, "ship 01"); |
|
|
|
|
} |
|
|
|
|
// FIXME: testing sim time
|
|
|
|
|
u64 ticks = SDL_GetTicks64(); |
|
|
|
|
static u32 last_T; |
|
|
|
|
u32 T = ticks / 1000; |
|
|
|
|
|
|
|
|
|
assert(satellite); |
|
|
|
|
updateSatelliteEntity(satellite, g_sys.sat); |
|
|
|
|
//updateOrbit(g_sys, ellipse_entity);
|
|
|
|
|
if (T != last_T) { |
|
|
|
|
LOGF(Debug, "seconds since sim start: %d\n", T); |
|
|
|
|
last_T = T; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|