lilith3d::TimeClock Class Reference

#include <timeclock.h>

List of all members.


Detailed Description

Time is critical to a 3D game. The TimeClock watches and monitors it, and returns the time between frames. It also counts frames.

Timekeepings is surprisingly complex.

The computation of light from the sun or moon is also part of the time class.


Public Member Functions

U32 CurrentFrame ()
 The current frame.
float Fps ()
 Frames per second, based on a 1 second sample.
float FastFps ()
 Frames per second, on the last 300 ms sample.
float TotalFPS ()
 The frames per second since Lilith was started.
float CalcVelocity (float vel)
float CalcChange (float value, float velocity, float minVal, float maxVal)
U32 Msec ()
 Get the current millisec since the time clock started.
float HoursElapsed ()
 Get the gametime in floating point hours, instead of milliseconds.
void CalcCalendarTime (U32 *days, U32 *hours, U32 *minutes, U32 *seconds)
 Get the gametime in clock units.
void ToggleSun ()
 Toggly mid-day on and off.


Member Function Documentation

float lilith3d::TimeClock::CalcVelocity ( float  vel  )  [inline]

The function used to calc any value that is a function of time. Converts speed (m/s) to distance traved in this tick (m).

float lilith3d::TimeClock::CalcChange ( float  value,
float  velocity,
float  minVal,
float  maxVal 
) [inline]

A subtle variant of CalcVelocity. Given a value, a velocity, and a range, change the value but keep it in range.


The documentation for this class was generated from the following file:
Generated on Fri Mar 23 19:36:29 2007 for Lilith3D by  doxygen 1.5.1-p1