Caelum
SkyDome.h
1 /*
2 This file is part of Caelum.
3 See http://www.ogre3d.org/wiki/index.php/Caelum
4 
5 Copyright (c) 2006-2007 Caelum team. See Contributors.txt for details.
6 
7 Caelum is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published
9 by the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Caelum is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License
18 along with Caelum. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef CAELUM__SKYDOME_H
22 #define CAELUM__SKYDOME_H
23 
24 #include "CaelumPrerequisites.h"
25 #include "CameraBoundElement.h"
26 #include "FastGpuParamRef.h"
27 #include "PrivatePtr.h"
28 
29 namespace Caelum
30 {
33  class CAELUM_EXPORT SkyDome : public CameraBoundElement
34  {
35  private:
38  static const Ogre::String SPHERIC_DOME_NAME;
39 
42  static const Ogre::String SKY_DOME_MATERIAL_NAME;
43 
45  PrivateSceneNodePtr mNode;
46 
48  PrivateMaterialPtr mMaterial;
49 
51  PrivateEntityPtr mEntity;
52 
53  private:
55  bool mShadersEnabled;
56 
58  bool mHazeEnabled;
59 
60  public:
65  SkyDome (Ogre::SceneManager *sceneMgr, Ogre::SceneNode *caelumRootNode);
66 
69  virtual ~SkyDome ();
70 
74  void setSunDirection (const Ogre::Vector3& dir);
75 
77  void setHazeColour (const Ogre::ColourValue& hazeColour);
78 
80  void setSkyGradientsImage (const Ogre::String& gradients);
81 
83  void setAtmosphereDepthImage (const Ogre::String& gradients);
84 
88  void setHazeEnabled (bool value);
89 
91  bool getHazeEnabled () const;
92 
93  void setQueryFlags (uint flags) { mEntity->setQueryFlags (flags); }
94  uint getQueryFlags () const { return mEntity->getQueryFlags (); }
95  void setVisibilityFlags (uint flags) { mEntity->setVisibilityFlags (flags); }
96  uint getVisibilityFlags () const { return mEntity->getVisibilityFlags (); }
97 
98  public:
100  virtual void notifyCameraChanged (Ogre::Camera *cam);
101 
102  protected:
104  virtual void setFarRadius (Ogre::Real radius);
105 
106  private:
107  struct Params {
108  void setup(Ogre::GpuProgramParametersSharedPtr vpParams, Ogre::GpuProgramParametersSharedPtr fpParams);
109 
110  Ogre::GpuProgramParametersSharedPtr vpParams;
111  Ogre::GpuProgramParametersSharedPtr fpParams;
112  FastGpuParamRef sunDirection;
113  FastGpuParamRef offset;
114  FastGpuParamRef hazeColour;
115  } mParams;
116  };
117 }
118 
119 #endif //CAELUM__SKYDOME_H
A sky dome element.
Definition: SkyDome.h:33
A camera-bound element.
An optimized reference to a gpu shared parameter.
Caelum namespace.
Definition: Astronomy.cpp:24