Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
BasicController.h
Go to the documentation of this file.
1/*
2--------------------------------------------------------------------------------
3This source file is part of SkyX.
4Visit http://www.paradise-studios.net/products/skyx/
5
6Copyright (C) 2009-2012 Xavier Vergu�n Gonz�lez <xavyiy@gmail.com>
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://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
31namespace SkyX
32{
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
Basic controller class
const Ogre::Vector2 & getEastDirection() const
Get east direction.
Ogre::Vector3 getMoonDirection()
Get moon direction.
void update(const Ogre::Real &simDeltaTime)
Update controller.
Ogre::Vector3 mSunDirection
Sun direction.
Ogre::Real getMoonPhase()
Get moon phase.
Ogre::Vector2 mEastDirection
East direction (in X,Z world coords)
void setMoonPhase(const Ogre::Real &mp)
Set moon phase.
Ogre::Vector3 getSunDirection()
Get sun direction.
void setEastDirection(const Ogre::Vector2 &ed)
Set eastn direction.
const Ogre::Vector3 & getTime() const
Get time.
Ogre::Real mMoonPhase
Moon phase.
Ogre::Vector3 mTime
Time information: x = time in [0, 24]h range, y = sunrise hour in [0, 24]h range, z = sunset hour in ...
void setTime(const Ogre::Vector3 &t)
Set time.
Ogre::Vector3 mMoonDirection
Moon direction.
Controller base class.
Definition Controller.h:34