RigsofRods
Soft-body Physics Simulation
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 BasicController : public Controller
36  {
37  public:
41  BasicController(const bool& deleteBySkyX = true);
42 
47  void update(const Ogre::Real& simDeltaTime);
48 
52  inline void setTime(const Ogre::Vector3& t)
53  {
54  mTime = t;
55  update(0);
56  }
57 
61  inline const Ogre::Vector3& getTime() const
62  {
63  return mTime;
64  }
65 
69  inline void setEastDirection(const Ogre::Vector2& ed)
70  {
71  mEastDirection = ed;
72  update(0);
73  }
74 
78  inline const Ogre::Vector2& getEastDirection() const
79  {
80  return mEastDirection;
81  }
82 
86  inline Ogre::Vector3 getSunDirection()
87  {
88  return mSunDirection;
89  }
90 
94  inline Ogre::Vector3 getMoonDirection()
95  {
96  return mMoonDirection;
97  }
98 
102  inline void setMoonPhase(const Ogre::Real& mp)
103  {
104  mMoonPhase = mp;
105  }
106 
110  inline Ogre::Real getMoonPhase()
111  {
112  return mMoonPhase;
113  }
114 
115  private:
117  Ogre::Vector3 mTime;
119  Ogre::Vector2 mEastDirection;
120 
122  Ogre::Vector3 mSunDirection;
124  Ogre::Vector3 mMoonDirection;
126  Ogre::Real mMoonPhase;
127  };
128 }
129 
130 #endif
SkyX::BasicController::mTime
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:117
SkyX::BasicController::setMoonPhase
void setMoonPhase(const Ogre::Real &mp)
Set moon phase.
Definition: BasicController.h:102
SkyX::BasicController
Basic controller class
Definition: BasicController.h:35
Prerequisites.h
SkyX::BasicController::getMoonDirection
Ogre::Vector3 getMoonDirection()
Get moon direction.
Definition: BasicController.h:94
SkyX::BasicController::setTime
void setTime(const Ogre::Vector3 &t)
Set time.
Definition: BasicController.h:52
Controller.h
SkyX::BasicController::BasicController
BasicController(const bool &deleteBySkyX=true)
Constructor.
Definition: BasicController.cpp:28
SkyX
Definition: AtmosphereManager.cpp:30
SkyX::BasicController::getTime
const Ogre::Vector3 & getTime() const
Get time.
Definition: BasicController.h:61
SkyX::BasicController::mEastDirection
Ogre::Vector2 mEastDirection
East direction (in X,Z world coords)
Definition: BasicController.h:119
SkyX::BasicController::mMoonDirection
Ogre::Vector3 mMoonDirection
Moon direction.
Definition: BasicController.h:124
SkyX::BasicController::getEastDirection
const Ogre::Vector2 & getEastDirection() const
Get east direction.
Definition: BasicController.h:78
SkyX::BasicController::setEastDirection
void setEastDirection(const Ogre::Vector2 &ed)
Set eastn direction.
Definition: BasicController.h:69
SkyX::BasicController::update
void update(const Ogre::Real &simDeltaTime)
Update controller.
Definition: BasicController.cpp:38
SkyX::BasicController::mSunDirection
Ogre::Vector3 mSunDirection
Sun direction.
Definition: BasicController.h:122
SkyX::BasicController::mMoonPhase
Ogre::Real mMoonPhase
Moon phase.
Definition: BasicController.h:126
SkyX::BasicController::getMoonPhase
Ogre::Real getMoonPhase()
Get moon phase.
Definition: BasicController.h:110
SkyX::Controller
Controller base class.
Definition: Controller.h:33
SkyX::BasicController::getSunDirection
Ogre::Vector3 getSunDirection()
Get sun direction.
Definition: BasicController.h:86