Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::TimeSystem Class Reference

Implementation of the ITime system interface. More...

#include <TimeSystem.h>

Inherits ITimeRequestBus::Handler.

Inherited by AZ::StubTimeSystem.

Public Member Functions

 AZ_RTTI (AZ::TimeSystem, "{CE1C5E4F-7DC1-4248-B10C-AC55E8924A48}", AZ::ITime)
 
TimeUs AdvanceTickDeltaTimes ()
 
void ApplyTickRateLimiterIfNeeded ()
 
TimeMs GetElapsedTimeMs () const override
 
TimeUs GetElapsedTimeUs () const override
 
TimeMs GetRealElapsedTimeMs () const override
 
TimeUs GetRealElapsedTimeUs () const override
 
void SetElapsedTimeMsDebug (TimeMs time) override
 
void SetElapsedTimeUsDebug (TimeUs time) override
 
TimeUs GetSimulationTickDeltaTimeUs () const override
 
TimeUs GetRealTickDeltaTimeUs () const override
 
TimeUs GetLastSimulationTickTime () const override
 
void SetSimulationTickDeltaOverride (TimeMs timeMs) override
 
void SetSimulationTickDeltaOverride (TimeUs timeUs) override
 
TimeUs GetSimulationTickDeltaOverride () const override
 
void SetSimulationTickScale (float scale) override
 
float GetSimulationTickScale () const override
 
void SetSimulationTickRate (int rate) override
 
int32_t GetSimulationTickRate () const override
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Detailed Description

Implementation of the ITime system interface.

Member Function Documentation

◆ AdvanceTickDeltaTimes()

TimeUs AZ::TimeSystem::AdvanceTickDeltaTimes ( )

Advances the Simulation and Real tick delta time counters. This is called from the owner of the TimeSystem, ComponentApplication in Tick().

Returns
The delta in microseconds from the last call to AdvanceTickDeltaTimes(). Value will be the same as GetSimulationTickDeltaTimeUs().

◆ ApplyTickRateLimiterIfNeeded()

void AZ::TimeSystem::ApplyTickRateLimiterIfNeeded ( )

If t_simulationTickRate is >0 this will try to have the game delta time run at a maximum of the rate set. This is called from the owner of the TimeSystem, ComponentApplication in Tick(). example. If t_simulationTickRate is set to 60Fps, and the game tick delta is <17ms(60fps), this will add a sleep for the remaining time. example. If t_simulationTickRate is set to 60Fps, and the game tick delta is >=17ms(60fps), this will not sleep at all.

Note
It is not guaranteed to hit the requested tick rate exactly.

◆ GetElapsedTimeMs()

TimeMs AZ::TimeSystem::GetElapsedTimeMs ( ) const
override

ITime overrides.


The documentation for this class was generated from the following file: