All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BasicController.h
Go to the documentation of this file.
1 /*
2 --------------------------------------------------------------------------------
3 This source file is part of SkyX.
4 Visit http://www.paradise-studios.net/products/skyx/
5 
6 Copyright (C) 2009-2012 Xavier Verguín González <xavyiy@gmail.com>
7 
8 This program is free software; you can redistribute it and/or modify it under
9 the terms of the GNU Lesser General Public License as published by the Free Software
10 Foundation; either version 2 of the License, or (at your option) any later
11 version.
12 
13 This program is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License along with
18 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20 http://www.gnu.org/copyleft/lesser.txt.
21 --------------------------------------------------------------------------------
22 */
23 
24 #ifndef _SkyX_BasicController_H_
25 #define _SkyX_BasicController_H_
26 
27 #include "Prerequisites.h"
28 
29 #include "Controller.h"
30 
31 namespace SkyX
32 {
35  class DllExport BasicController : public Controller
36  {
37  public:
42  BasicController(const bool& deleteBySkyX = true);
43 
50  void update(const Ogre::Real& simDeltaTime);
51 
56  inline void setTime(const Ogre::Vector3& t)
57  {
58  mTime = t;
59  update(0);
60  }
61 
66  inline const Ogre::Vector3& getTime() const
67  {
68  return mTime;
69  }
70 
74  inline void setEastDirection(const Ogre::Vector2& ed)
75  {
76  mEastDirection = ed;
77  update(0);
78  }
79 
83  inline const Ogre::Vector2& getEastDirection() const
84  {
85  return mEastDirection;
86  }
87 
91  inline Ogre::Vector3 getSunDirection()
92  {
93  return mSunDirection;
94  }
95 
99  inline Ogre::Vector3 getMoonDirection()
100  {
101  return mMoonDirection;
102  }
103 
108  inline void setMoonPhase(const Ogre::Real& mp)
109  {
110  mMoonPhase = mp;
111  }
112 
117  inline Ogre::Real getMoonPhase()
118  {
119  return mMoonPhase;
120  }
121 
122  private:
125  Ogre::Vector3 mTime;
126 
128  Ogre::Vector3 mSunDirection;
129 
131  Ogre::Vector3 mMoonDirection;
132 
134  Ogre::Vector2 mEastDirection;
135 
137  Ogre::Real mMoonPhase;
138  };
139 }
140 
141 #endif
Ogre::Vector3 mMoonDirection
Moon direction.
Definition: BasicController.h:131
Ogre::Vector2 mEastDirection
East direction (in X,Z world coords)
Definition: BasicController.h:134
Ogre::Vector3 getSunDirection()
Get sun direction.
Definition: BasicController.h:91
Ogre::Vector3 mTime
Time information: x = time in [0, 24]h range, y = sunrise hour in [0, 24]h range, z = sunset hour in ...
Definition: BasicController.h:125
void setTime(const Ogre::Vector3 &t)
Set time.
Definition: BasicController.h:56
const Ogre::Vector2 & getEastDirection() const
Get east direction.
Definition: BasicController.h:83
Ogre::Vector3 mSunDirection
Sun direction.
Definition: BasicController.h:128
void setEastDirection(const Ogre::Vector2 &ed)
Set eastn direction.
Definition: BasicController.h:74
Ogre::Real getMoonPhase()
Get moon phase.
Definition: BasicController.h:117
SkyX(Ogre::SceneManager *sm, Controller *c)
Contructor.
Ogre::Vector3 getMoonDirection()
Get moon direction.
Definition: BasicController.h:99
void setMoonPhase(const Ogre::Real &mp)
Set moon phase.
Definition: BasicController.h:108
const Ogre::Vector3 & getTime() const
Get time.
Definition: BasicController.h:66
Ogre::Real mMoonPhase
Moon phase.
Definition: BasicController.h:137
class __declspec(dllimport) BasicController void update(const Ogre::Real &simDeltaTime)
Basic controller class.
#define DllExport
Include external headers.
Definition: Prerequisites.h:45