RelativeTimeUpdate is a scheduler that runs systems at a defined rate. The tick rate is the maximum time we want between each system run. If the time between each system run is more than the target tick rate, we will run the systems multiple times with a delta time equal to the tick rate. Else, we will just run the systems once with the delta time we have (remaining).
More...
#include <RelativeTimeUpdate.hpp>
|
| float | _tickRate |
| | The target tick rate for the scheduler. It is the maximum time we want between each system run. If the time between each system run is more than the target tick rate, we will run the systems multiple times with a delta time equal to the tick rate. After tick rate time has passed, if there is a remainder time that is greater than the remainder threshold, he will run the systems one more time with the remainder time as delta time. Else, he will just add the remainder time to the buffered time for the next tick. This is to avoid running the systems with a very small delta time.
|
| float | _deltaTime = 0.0f |
| | The current delta time. It is the time between the last system run and the current system run. This value may be modified by the scheduler to run the systems multiple times if the time between each system run is more than the target tick rate.
|
| float | _bufferedTime = 0.0f |
| | Time accumulated from the previous ticks that is less than the threshold. This time will be added to the delta time of the next tick. This is to avoid running the systems with a very small delta time.
|
|
| static constexpr float | DEFAULT_TARGET_TICK_RATE = 1.0f / 50.0f |
| | The default target tick rate for the RelativeTimeUpdate scheduler. It is set to 1/50 seconds, which means that the scheduler will try to run the systems at a maximum rate of 50 times per second.
|
| static constexpr float | REMAINDER_THRESHOLD = 0.0001f |
| | The threshold for the remainder time. If the remainder time is less than this threshold, we will not run the systems with the remainder time as delta time, and we will just add the remainder time to the buffered time for the next tick. This is to avoid running the systems with a very small delta time, which can cause issues.
|
RelativeTimeUpdate is a scheduler that runs systems at a defined rate. The tick rate is the maximum time we want between each system run. If the time between each system run is more than the target tick rate, we will run the systems multiple times with a delta time equal to the tick rate. Else, we will just run the systems once with the delta time we have (remaining).
◆ RelativeTimeUpdate()
◆ GetCurrentDeltaTime()
| float Engine::Scheduler::RelativeTimeUpdate::GetCurrentDeltaTime |
( |
| ) |
const |
|
inline |
◆ GetTargetTickRate()
| float Engine::Scheduler::RelativeTimeUpdate::GetTargetTickRate |
( |
| ) |
const |
|
inline |
◆ RunSystems()
| void Engine::Scheduler::RelativeTimeUpdate::RunSystems |
( |
void | | ) |
|
|
overridevirtual |
◆ SetTargetTickRate()
| void Engine::Scheduler::RelativeTimeUpdate::SetTargetTickRate |
( |
float | tickRate | ) |
|
|
inline |
◆ _bufferedTime
| float Engine::Scheduler::RelativeTimeUpdate::_bufferedTime = 0.0f |
|
private |
◆ _deltaTime
| float Engine::Scheduler::RelativeTimeUpdate::_deltaTime = 0.0f |
|
private |
The current delta time. It is the time between the last system run and the current system run. This value may be modified by the scheduler to run the systems multiple times if the time between each system run is more than the target tick rate.
- See also
- Engine::Scheduler::RelativeTimeUpdate::GetCurrentDeltaTime
◆ _tickRate
| float Engine::Scheduler::RelativeTimeUpdate::_tickRate |
|
private |
◆ DEFAULT_TARGET_TICK_RATE
| float Engine::Scheduler::RelativeTimeUpdate::DEFAULT_TARGET_TICK_RATE = 1.0f / 50.0f |
|
inlinestaticconstexprprivate |
The default target tick rate for the RelativeTimeUpdate scheduler. It is set to 1/50 seconds, which means that the scheduler will try to run the systems at a maximum rate of 50 times per second.
◆ REMAINDER_THRESHOLD
| float Engine::Scheduler::RelativeTimeUpdate::REMAINDER_THRESHOLD = 0.0001f |
|
inlinestaticconstexprprivate |
The threshold for the remainder time. If the remainder time is less than this threshold, we will not run the systems with the remainder time as delta time, and we will just add the remainder time to the buffered time for the next tick. This is to avoid running the systems with a very small delta time, which can cause issues.
The documentation for this class was generated from the following files: