SO3::SUniversalClock Class Reference

#include <SO3UniversalClock.h>

List of all members.

Public Member Functions

 SUniversalClock ()
void SetTimeScale (const float scale)
float GetTimeScale () const
void Update (const float time)
void SetJulianDay (double value)
void SetGregorianDateTime (int year, int month, int day, int hour, int minute, double second)
void GetGregorianDateTime (int &year, int &month, int &day, int &hour, int &minute, double &second)
double GetJulianDay () const
double GetJulianDayDifference () const
double GetJulianSecond () const
double GetJulianSecondDifference () const

Static Public Attributes

static const double SECONDS_PER_DAY = 86400.0
 Number of seconds per day; exactly 60*60*24.

Detailed Description

The system's time model. This class is responsible of keeping track of current astronomical time and syncronising with ogre time.

It maintains a snapshot point: At mCurrentTime == 0 julian day was mJulianDayBase. At any time the julian day can be calculated from mCurrentTime and mJulianDayBase. This increases precission; mCurrentTime is tracked in seconds while mJulianDayBase uses days. It would be silly to track the current time in days.

Definition at line 48 of file SO3UniversalClock.h.


Constructor & Destructor Documentation

SO3::SUniversalClock::SUniversalClock (  ) 

Constructor.

Definition at line 40 of file SO3UniversalClock.cpp.


Member Function Documentation

void SO3::SUniversalClock::GetGregorianDateTime ( int &  year,
int &  month,
int &  day,
int &  hour,
int &  minute,
double &  second 
)

Definition at line 52 of file SO3UniversalClock.cpp.

double SO3::SUniversalClock::GetJulianDay (  )  const

Get current julian day.

Definition at line 65 of file SO3UniversalClock.cpp.

double SO3::SUniversalClock::GetJulianDayDifference (  )  const

Get the difference in julian day between this and the last update. This is most likely very small and unprecise.

Definition at line 72 of file SO3UniversalClock.cpp.

double SO3::SUniversalClock::GetJulianSecond (  )  const

Get the current julian second (getJulianDay * SECONDS_PER_DAY) This is most likely very very large and unprecise.

Definition at line 78 of file SO3UniversalClock.cpp.

double SO3::SUniversalClock::GetJulianSecondDifference (  )  const

Get the difference in seconds between this and the last update. This is what you want for per-frame updates.

Definition at line 85 of file SO3UniversalClock.cpp.

Ogre::Real SO3::SUniversalClock::GetTimeScale (  )  const

Gets the time scale.

Returns:
The current time scale. Defaults to 1.

Definition at line 96 of file SO3UniversalClock.cpp.

void SO3::SUniversalClock::SetGregorianDateTime ( int  year,
int  month,
int  day,
int  hour,
int  minute,
double  second 
)

Set the current time as a gregorian date. This is here as an easy to use function.

Definition at line 46 of file SO3UniversalClock.cpp.

void SO3::SUniversalClock::SetJulianDay ( double  value  ) 

Set the current time as a julian day. Set the current time as a julian day, which you build using one of the static getJulianDayFromXXX functions. Defaults to J2000 (noon january 1st)

Definition at line 58 of file SO3UniversalClock.cpp.

void SO3::SUniversalClock::SetTimeScale ( const float  scale  ) 

Sets the time scale.

Parameters:
scale The new time scale. If negative, time will move backwards; 2.0 means double speed...

Definition at line 91 of file SO3UniversalClock.cpp.

void SO3::SUniversalClock::Update ( const float  time  ) 

Updates the clock.

Parameters:
time The time to be added to the clock. It will beaffected by the time scale.

Definition at line 101 of file SO3UniversalClock.cpp.


Member Data Documentation

const double SO3::SUniversalClock::SECONDS_PER_DAY = 86400.0 [static]

Number of seconds per day; exactly 60*60*24.

Definition at line 51 of file SO3UniversalClock.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Mon Oct 31 14:42:39 2011 for SO3Engine by  doxygen 1.6.3