Caelum
UniversalClock.h
1 /*
2 This file is part of Caelum.
3 See http://www.ogre3d.org/wiki/index.php/Caelum
4 
5 Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
6 
7 Caelum is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published
9 by the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Caelum is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License
18 along with Caelum. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef UNIVERSALCLOCK_H
22 #define UNIVERSALCLOCK_H
23 
24 #include "CaelumPrerequisites.h"
25 
26 namespace Caelum {
27 
37  class CAELUM_EXPORT UniversalClock
38  {
39  private:
41  LongReal mJulianDayBase;
42 
44  LongReal mCurrentTime;
45 
47  LongReal mLastUpdateTime;
48 
50  Ogre::Real mTimeScale;
51 
52  public:
55  static const LongReal SECONDS_PER_DAY;
56 
59  UniversalClock ();
60 
64  void setTimeScale (const Ogre::Real scale);
65 
69  Ogre::Real getTimeScale () const;
70 
74  void update (const Ogre::Real time);
75 
81  void setJulianDay(LongReal value);
82 
86  void setGregorianDateTime(
87  int year, int month, int day,
88  int hour, int minute, double second);
89 
92  LongReal getJulianDay() const;
93 
97  LongReal getJulianDayDifference() const;
98 
102  LongReal getJulianSecond() const;
103 
107  LongReal getJulianSecondDifference() const;
108  };
109 }
110 
111 #endif //UNIVERSALCLOCK_H
The system&#39;s time model.
static const LongReal SECONDS_PER_DAY
Number of seconds per day; exactly 60*60*24.
Caelum namespace.
Definition: Astronomy.cpp:24