RigsofRods
Soft-body Physics Simulation
MoonManager.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_MoonManager_H_
25 #define _SkyX_MoonManager_H_
26 
27 #include "Prerequisites.h"
28 
29 namespace SkyX
30 {
31  class SkyX;
32 
33  class MoonManager
34  {
35  public:
39  MoonManager(SkyX *s);
40 
43  ~MoonManager();
44 
47  void create();
48 
51  void remove();
52 
56  void updateMoonPhase(const Ogre::Real& phase);
57 
61  void updateGeometry(Ogre::Camera* c);
62 
66  inline Ogre::BillboardSet* getMoonBillboard()
67  {
68  return mMoonBillboard;
69  }
70 
74  inline Ogre::SceneNode* getMoonSceneNode()
75  {
76  return mMoonSceneNode;
77  }
78 
82  inline void setMoonSize(const Ogre::Real& MoonSize)
83  {
84  mMoonSize = MoonSize;
85  }
86 
90  inline const Ogre::Real& getMoonSize() const
91  {
92  return mMoonSize;
93  }
94 
98  inline void setMoonHaloIntensity(const Ogre::Real& MoonHaloIntensity)
99  {
100  mMoonHaloIntensity = MoonHaloIntensity;
101  }
102 
106  inline const Ogre::Real& getMoonHaloIntensity() const
107  {
108  return mMoonHaloIntensity;
109  }
110 
114  inline void setMoonHaloStrength(const Ogre::Real& MoonHaloStrength)
115  {
116  mMoonHaloStrength = MoonHaloStrength;
117  }
118 
122  inline const Ogre::Real& getMoonHaloStrength() const
123  {
124  return mMoonHaloStrength;
125  }
126 
130  inline const bool& isCreated() const
131  {
132  return mCreated;
133  }
134 
135  private:
139  void _updateMoonBounds(Ogre::Camera* c);
140 
142  Ogre::BillboardSet* mMoonBillboard;
144  Ogre::SceneNode* mMoonSceneNode;
145 
147  bool mCreated;
148 
150  Ogre::Real mMoonSize;
152  Ogre::Real mMoonHaloIntensity;
154  Ogre::Real mMoonHaloStrength;
155 
157  Ogre::MaterialPtr mMoonMaterial;
158 
161  };
162 }
163 
164 #endif
SkyX::MoonManager::getMoonSceneNode
Ogre::SceneNode * getMoonSceneNode()
Get moon scene node.
Definition: MoonManager.h:74
SkyX::MoonManager::mMoonBillboard
Ogre::BillboardSet * mMoonBillboard
Moon billboard.
Definition: MoonManager.h:142
SkyX::MoonManager::mMoonSceneNode
Ogre::SceneNode * mMoonSceneNode
Moon scene node.
Definition: MoonManager.h:144
Prerequisites.h
SkyX::MoonManager::MoonManager
MoonManager(SkyX *s)
Constructor.
Definition: MoonManager.cpp:30
SkyX
Definition: AtmosphereManager.cpp:30
SkyX::MoonManager::remove
void remove()
Remove all resources.
Definition: MoonManager.cpp:77
SkyX::MoonManager
Definition: MoonManager.h:33
SkyX::MoonManager::mMoonHaloIntensity
Ogre::Real mMoonHaloIntensity
Moon halo intensity.
Definition: MoonManager.h:152
SkyX::MoonManager::mMoonMaterial
Ogre::MaterialPtr mMoonMaterial
Moon material.
Definition: MoonManager.h:157
SkyX::MoonManager::mSkyX
SkyX * mSkyX
SkyX parent pointer.
Definition: MoonManager.h:160
SkyX::MoonManager::mMoonSize
Ogre::Real mMoonSize
Moon size.
Definition: MoonManager.h:150
SkyX::MoonManager::create
void create()
Create all resources.
Definition: MoonManager.cpp:47
SkyX::MoonManager::updateGeometry
void updateGeometry(Ogre::Camera *c)
Update geometry.
Definition: MoonManager.cpp:267
SkyX::MoonManager::getMoonHaloIntensity
const Ogre::Real & getMoonHaloIntensity() const
Get moon halo intensity.
Definition: MoonManager.h:106
SkyX::MoonManager::setMoonSize
void setMoonSize(const Ogre::Real &MoonSize)
Set moon size.
Definition: MoonManager.h:82
SkyX::MoonManager::getMoonBillboard
Ogre::BillboardSet * getMoonBillboard()
Get moon billboard.
Definition: MoonManager.h:66
SkyX::MoonManager::setMoonHaloIntensity
void setMoonHaloIntensity(const Ogre::Real &MoonHaloIntensity)
Set moon halo intensity.
Definition: MoonManager.h:98
SkyX::MoonManager::~MoonManager
~MoonManager()
Destructor.
Definition: MoonManager.cpp:42
SkyX::MoonManager::getMoonSize
const Ogre::Real & getMoonSize() const
Get moon size.
Definition: MoonManager.h:90
SkyX::MoonManager::_updateMoonBounds
void _updateMoonBounds(Ogre::Camera *c)
Update moon bounds.
Definition: MoonManager.cpp:302
SkyX::MoonManager::updateMoonPhase
void updateMoonPhase(const Ogre::Real &phase)
Update moon phase.
Definition: MoonManager.cpp:96
SkyX::MoonManager::getMoonHaloStrength
const Ogre::Real & getMoonHaloStrength() const
Get moon halo strength.
Definition: MoonManager.h:122
SkyX::MoonManager::isCreated
const bool & isCreated() const
Is moon manager created?
Definition: MoonManager.h:130
SkyX::MoonManager::mMoonHaloStrength
Ogre::Real mMoonHaloStrength
Moon halo strength.
Definition: MoonManager.h:154
SkyX::MoonManager::mCreated
bool mCreated
Is moon manager created?
Definition: MoonManager.h:147
SkyX::MoonManager::setMoonHaloStrength
void setMoonHaloStrength(const Ogre::Real &MoonHaloStrength)
Set moon halo strength.
Definition: MoonManager.h:114