Caelum
Moon.h
1 /*
2 This file is part of Caelum.
3 See http://www.ogre3d.org/wiki/index.php/Caelum
4 
5 Copyright (c) 2008 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__MOON_H
22 #define CAELUM__MOON_H
23 
24 #include "CaelumPrerequisites.h"
25 #include "SkyLight.h"
26 #include "FastGpuParamRef.h"
27 #include "PrivatePtr.h"
28 
29 namespace Caelum
30 {
35  class CAELUM_EXPORT Moon:
36  public BaseSkyLight
37  {
38  public:
40  static const Ogre::String MOON_MATERIAL_NAME;
41 
43  static const Ogre::String MOON_BACKGROUND_MATERIAL_NAME;
44 
45  private:
47  PrivateMaterialPtr mMoonMaterial;
48 
50  PrivateBillboardSetPtr mMoonBB;
51 
53  PrivateMaterialPtr mBackMaterial;
54 
56  PrivateBillboardSetPtr mBackBB;
57 
59  Ogre::Degree mAngularSize;
60 
61  struct Params {
62  void setup(Ogre::GpuProgramParametersSharedPtr fpParams);
63 
64  Ogre::GpuProgramParametersSharedPtr fpParams;
65  FastGpuParamRef phase;
66  } mParams;
67 
68  public:
71  Moon (
72  Ogre::SceneManager *sceneMgr,
73  Ogre::SceneNode *caelumRootNode,
74  const Ogre::String& moonTextureName = "moon_disc.dds",
75  Ogre::Degree angularSize = Ogre::Degree(3.77f));
76 
77  virtual ~Moon ();
78 
82  void setMoonTexture (const Ogre::String &textureName);
83 
87  void setMoonTextureAngularSize(const Ogre::Degree& moonTextureAngularSize);
88 
92  void setBodyColour (const Ogre::ColourValue &colour);
93 
95  void setPhase (Ogre::Real phase);
96 
98  void setMoonNorthPoleDirection(const Ogre::Vector3& moonNorthPoleDir);
99 
100  public:
102  virtual void notifyCameraChanged (Ogre::Camera *cam);
103 
104  virtual void setQueryFlags (uint flags);
105  virtual uint getQueryFlags () const;
106  virtual void setVisibilityFlags (uint flags);
107  virtual uint getVisibilityFlags () const;
108  };
109 }
110 
111 #endif // CAELUM__MOON_H
static const Ogre::String MOON_BACKGROUND_MATERIAL_NAME
Name of the moon background material.
Definition: Moon.h:43
Base class for sky lights (sun and moon).
Definition: SkyLight.h:31
static const Ogre::String MOON_MATERIAL_NAME
Name of the moon material.
Definition: Moon.h:40
Class representing the moon.
Definition: Moon.h:35
An optimized reference to a gpu shared parameter.
Caelum namespace.
Definition: Astronomy.cpp:24