Umasoft
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
TimeEngines.h
1 //
2 // TimeEngines.h
3 //
4 // Copyright (c) 2001-2006 Virtual Terrain Project
5 // Free for all uses, see license.txt for details.
6 //
7 
8 #ifndef TIMEENGINESH
9 #define TIMEENGINESH
10 
11 #include "Engine.h"
12 #include "vtdata/vtTime.h"
13 
16 
21 class vtTimeTarget : public osg::Referenced
22 {
23 public:
24  virtual void SetTime(const vtTime &time) {}
25 };
26 
34 class vtTimeEngine : public vtEngine
35 {
36 public:
37  vtTimeEngine(int start_hour = -1);
38 
39  void Eval();
40 
41  void SetTime(const vtTime &time);
42  void GetTime(vtTime &time) const;
43  vtTime GetTime() const;
44 
45  void SetSpeed(float factor);
46  float GetSpeed() { return m_fSpeed; }
47 
48 protected:
49  void _InformTarget();
50 
51  float m_fSeconds;
52  float m_fSpeed;
53  float m_last_time;
54 
55  vtTime m_time;
56 };
57  // Group eng
59 
60 #endif // TIMEENGINESH
61