~ubuntu-branches/debian/sid/ember/sid

« back to all changes in this revision

Viewing changes to src/components/ogre/environment/caelum/include/SkyDome.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2009-07-23 07:46:40 UTC
  • Revision ID: james.westby@ubuntu.com-20090723074640-wh0ukzis0kda36qv
Tags: upstream-0.5.6
Import upstream version 0.5.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 SKYDOME_H
 
22
#define SKYDOME_H
 
23
 
 
24
#include "CaelumPrerequisites.h"
 
25
#include "CameraBoundElement.h"
 
26
 
 
27
namespace caelum {
 
28
 
 
29
/** A sky dome element.
 
30
        @author Jes˙s Alonso Abad
 
31
 */
 
32
class CAELUM_EXPORT SkyDome : public CameraBoundElement {
 
33
// Attributes -----------------------------------------------------------------
 
34
        private:
 
35
                /** Control scene node.
 
36
                 */
 
37
                Ogre::SceneNode *mNode;
 
38
 
 
39
                /** Name of the spheric dome resource.
 
40
                 */
 
41
                static const Ogre::String SPHERIC_DOME_NAME;
 
42
 
 
43
                /** Name of the dome material.
 
44
                 */
 
45
                static const Ogre::String SKY_DOME_MATERIAL_NAME;
 
46
 
 
47
                /// Reference to the sky dome material.
 
48
                Ogre::MaterialPtr mMaterial;
 
49
 
 
50
                /// True if selected technique has shaders.
 
51
                bool mShadersEnabled;
 
52
 
 
53
        /// If haze is enabled.
 
54
        bool mHazeEnabled;
 
55
 
 
56
// Methods --------------------------------------------------------------------
 
57
        public:
 
58
                /** Constructor
 
59
         *  This will setup some nice defaults.
 
60
                 *  @param sceneMgr The scene manager where this sky dome will be created.
 
61
                 */
 
62
                SkyDome (Ogre::SceneManager *sceneMgr, Ogre::SceneNode *caelumRootNode);
 
63
 
 
64
                /** Destructor
 
65
                 */
 
66
                virtual ~SkyDome ();
 
67
 
 
68
                /** Sets the sun direction.
 
69
                        @param dir The sun light direction.
 
70
                 */
 
71
                void setSunDirection (Ogre::Vector3 dir);
 
72
 
 
73
        /// Explicit haze colour.
 
74
        void setHazeColour (Ogre::ColourValue hazeColour);
 
75
 
 
76
                /** Sets the new light absorption factor.
 
77
                        @param absorption The light absorption factor; a number in the range [0, 1], the lower, the less light the atmosphere will absorb.
 
78
                 */
 
79
                void setLightAbsorption (float absorption) const;
 
80
 
 
81
                /** Sets the light scattering factor. 
 
82
                        @param scattering The light scattering factor; a number major than zero.
 
83
                 */
 
84
                void setLightScattering (float scattering) const;
 
85
 
 
86
                /** Sets the atmosphere height factor. 
 
87
                        @param height The atmosphere height factor; a number in the range (0, 1].
 
88
                 */
 
89
                void setAtmosphereHeight (float height) const;
 
90
 
 
91
        /// Set the sky color gradients image.
 
92
        void setSkyGradientsImage (const Ogre::String& gradients);
 
93
 
 
94
        /// Set the atmosphere depthh gradient image.
 
95
        void setAtmosphereDepthImage (const Ogre::String& gradients);
 
96
 
 
97
        /// If skydome haze is enabled.
 
98
        bool getHazeEnabled () const;
 
99
 
 
100
        /** Enable or disable skydome haze. This makes the sky darker.
 
101
         *  By default haze is disabled.
 
102
         */
 
103
        void setHazeEnabled (bool value);
 
104
 
 
105
    public:
 
106
                /// Handle camera change.
 
107
                virtual void notifyCameraChanged (Ogre::Camera *cam);
 
108
 
 
109
    protected:
 
110
        /// Handle far radius.
 
111
            virtual void setFarRadius (Ogre::Real radius);
 
112
};
 
113
 
 
114
} // namespace caelum
 
115
 
 
116
#endif //SKYDOME_H