Wraith  0.1.5
Basic 3D game engine in C++
Time Manager

The TimeManager hold and gives user information regarding time. Also has freeze framing tool for debuggung. More...

Collaboration diagram for Time Manager:

Functions

static float TimeManager::GetTimeInSeconds ()
 Gets time in seconds since the game started. More...
 
static float TimeManager::GetElaspedFrameTimeInSeconds ()
 Gets elasped frame time in seconds (Time between frames). More...
 

Detailed Description

The TimeManager hold and gives user information regarding time. Also has freeze framing tool for debuggung.

The TimeManager offers time information such as total time the game as been running and giving the time between frames. The freeze framing tool can be activated and deactived by pressing F10. Use F9 to progress to the next frame

Here is a example of how the TimeManager could be used. NOTE: You must include the TimeManager.h header file.

#include "TimeManager.h"
Bullet::Bullet()
{
_position = Vect(0.0f, 0.0f, 0.0f);
_direction = Vect(0.0f, 0.0f, 1.0f);
_speed = 10.0f;
}
Bullet::update()
{
this->move();
}
Bullet::move()
{
// using frame time here for moving bullet
_position += _direction * _speed * _deltaTime;
// Then update neccessary data within bullet to use position
// such as updating world matrix for model
}
static float GetElaspedFrameTimeInSeconds()
Gets elasped frame time in seconds (Time between frames).
Definition: TimeManager.h:73
void submitUpdateRegistration()
Submit update registration to current scene.
Definition: Updatable.cpp:24

Function Documentation

◆ GetElaspedFrameTimeInSeconds()

static float TimeManager::GetElaspedFrameTimeInSeconds ( )
inlinestatic

Gets elasped frame time in seconds (Time between frames).

Returns
The elasped frame time in seconds.

◆ GetTimeInSeconds()

static float TimeManager::GetTimeInSeconds ( )
inlinestatic

Gets time in seconds since the game started.

Returns
The time in seconds.