IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
ice::CustomClock Struct Reference

A custom clock allows to control the "speed" of calculated time. More...

#include <ice/clock.hxx>

Inheritance diagram for ice::CustomClock:
ice::Clock

Public Attributes

ice::Clock const * _clock_base
ice::f32 modifier
Public Attributes inherited from ice::Clock
ice::Timestamp _ts_previous
ice::Timestamp _ts_latest

Detailed Description

A custom clock allows to control the "speed" of calculated time.

This works by calculating the update values from the parent clock. The parents current time difference is taken, and a modifier is applied. The result of this operation is the stored under the inherited Clock::latest_timestamp member. This moves the previous Clock::latest_timestamp value to the Clock::previous_timestamp member.

Precondition
A Custom clock is only valid if the CustomClock::_clock_base member is not-null.
Remarks
The user is allowed to set the modifier to 0.0f or negative values, reversing time. (whoaaaa...)
Note
To have consistent time changes, udpate child clocks the exact same number of times like their parents.

Member Data Documentation

◆ _clock_base

ice::Clock const* ice::CustomClock::_clock_base

◆ modifier

ice::f32 ice::CustomClock::modifier

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