Class TimeStep

Class Documentation

class TimeStep

Responsible for calculating the amount of time which has passed between rendering two frames. Since every machine has slightly different speed, it is necessary to the timestep when animating something.

Todo:

Implement time step for every thread?

Public Functions

TimeStep()
float time_step()

Return a scaling factor which corresponds to the time which has passed since last render call and now.

float time_step_since_initialisation()

Return a scaling factor which corresponds to the time which has passed since initialisation and now.

Private Members

std::chrono::time_point<std::chrono::high_resolution_clock> m_last_time
std::chrono::time_point<std::chrono::high_resolution_clock> m_initialisation_time