QuasarEngine
Cross-platform 3D engine and editor
Loading...
Searching...
No Matches
Quasar::Timestep Class Reference

Time elapsed between two frames, in seconds. More...

#include <quasar/core/Timestep.h>

Public Member Functions

constexpr Timestep ()=default
 Creates a Timestep of 0 seconds.
constexpr Timestep (float seconds)
 Creates a Timestep of the given number of seconds.
constexpr float GetSeconds () const
 Returns the duration in seconds.
constexpr float GetMilliseconds () const
 Returns the duration in milliseconds.
constexpr operator float () const
 Implicit conversion to float, returning the duration in seconds.

Detailed Description

Time elapsed between two frames, in seconds.

A Timestep converts to float implicitly, so it can be used directly in computations: position += speed * timestep.

Constructor & Destructor Documentation

◆ Timestep()

Quasar::Timestep::Timestep ( float seconds)
inlineexplicitconstexpr

Creates a Timestep of the given number of seconds.

Parameters
secondsDuration in seconds.

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