New answers tagged

0

For this purpose I would use Verlet integration. It's nice and easy to implement algorithm. You can read more about it here.


0

They way I've gone about calculating the delta time has been via SDL_GetTicks(): struct Clock { uint32_t last_tick_time = 0; uint32_t delta = 0; void tick() { uint32_t tick_time = SDL_GetTicks(); delta = tick_time - last_tick_time; last_tick_time = tick_time; } }; Then I simply tick a Clock instance in the main ...



Top 50 recent answers are included