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 DllExport 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  void setVisible(bool _visible)
136  {
137  this->mVisible = _visible;
138  this->mMoonSceneNode->setVisible(_visible);
139  }
140 
141  void setEnabled(bool _enabled)
142  {
143  bool visible = _enabled ? mVisible : false;
144  this->mMoonSceneNode->setVisible(visible);
145  }
146 
147  private:
151  void _updateMoonBounds(Ogre::Camera* c);
152 
154  SkyX *mSkyX;
155 
157  Ogre::BillboardSet* mMoonBillboard;
159  Ogre::SceneNode* mMoonSceneNode;
160 
162  bool mCreated;
163 
165  Ogre::Real mMoonSize;
167  Ogre::Real mMoonHaloIntensity;
169  Ogre::Real mMoonHaloStrength;
170 
172  Ogre::MaterialPtr mMoonMaterial;
173 
175  bool mVisible;
176  };
177 }
178 
179 #endif
void create()
Create SkyX.
SkyX(Ogre::SceneManager *sm, Controller *c)
Contructor.
void setEnabled(bool _enabled)
Definition: SkyX.h:355
bool mCreated
Is SkyX created?
Definition: SkyX.h:422
void setVisible(const bool &visible)
Set visible.
#define DllExport
Include external headers.
Definition: Prerequisites.h:45
bool mVisible
Is SkyX visible?
Definition: SkyX.h:432
bool isCreated() const
Is SkyX created?
Definition: SkyX.h:147