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

« back to all changes in this revision

Viewing changes to src/components/ogre/environment/SimpleEnvironment.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
// C++ Interface: SimpleEnvironment
 
3
//
 
4
// Description: 
 
5
//
 
6
//
 
7
// Author: Erik Hjortsberg <erik.hjortsberg@gmail.com>, (C) 2008
 
8
//
 
9
// This program is free software; you can redistribute it and/or modify
 
10
// it under the terms of the GNU General Public License as published by
 
11
// the Free Software Foundation; either version 2 of the License, or
 
12
// (at your option) any later version.
 
13
// 
 
14
// This program is distributed in the hope that it will be useful,
 
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
// GNU General Public License for more details.
 
18
// 
 
19
// You should have received a copy of the GNU General Public License
 
20
// along with this program; if not, write to the Free Software
 
21
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.//
 
22
//
 
23
#ifndef EMBEROGRE_ENVIRONMENTSIMPLEENVIRONMENT_H
 
24
#define EMBEROGRE_ENVIRONMENTSIMPLEENVIRONMENT_H
 
25
 
 
26
#include "Environment.h"
 
27
 
 
28
 
 
29
namespace Ogre
 
30
{
 
31
class SceneManager;
 
32
class RenderWindow;
 
33
class Camera;
 
34
}
 
35
 
 
36
namespace EmberOgre {
 
37
 
 
38
namespace Environment {
 
39
 
 
40
/**
 
41
A very simple sun which always will return the same direction.
 
42
*/
 
43
class SimpleSun : public ISun
 
44
{
 
45
public:
 
46
        virtual void setAmbientLight(const Ogre::ColourValue& colour);
 
47
        virtual Ogre::Vector3 getSunDirection() const;
 
48
protected:
 
49
};
 
50
 
 
51
/**
 
52
A very simple sky which won't do anything currently.
 
53
*/
 
54
class SimpleSky : public ISky
 
55
{
 
56
public:
 
57
protected:
 
58
};
 
59
 
 
60
/**
 
61
A very simple fog which will always return a density of 1.0
 
62
*/
 
63
class SimpleFog : public IFog
 
64
{
 
65
public:
 
66
        virtual void setDensity(float density);
 
67
        virtual float getDensity() const;
 
68
protected:
 
69
};
 
70
 
 
71
class Water;
 
72
 
 
73
 
 
74
 
 
75
/**
 
76
        @author Erik Hjortsberg <erik.hjortsberg@gmail.com>
 
77
        
 
78
        A very simple environment which can be used as a fallback environment if a more advanced environment fails to load.
 
79
*/
 
80
class SimpleEnvironment : public IEnvironmentProvider
 
81
{
 
82
public:
 
83
    SimpleEnvironment(Ogre::SceneManager *sceneMgr, Ogre::RenderWindow* window, Ogre::Camera& camera);
 
84
 
 
85
    virtual ~SimpleEnvironment();
 
86
    
 
87
        virtual void createEnvironment();
 
88
 
 
89
        virtual ISun* getSun();
 
90
        virtual ISky* getSky();
 
91
        virtual IFog* getFog();
 
92
        virtual IWater* getWater();
 
93
 
 
94
    virtual void setTime(int hour, int minute, int second = 0);
 
95
        virtual void setTime(int seconds);
 
96
        
 
97
        /**
 
98
         * @brief Sets the position of the world.
 
99
         * @param longitudeDegrees The longitude, as degrees.
 
100
         * @param latitudeDegrees The latitude, as degrees.
 
101
         */
 
102
        virtual void setWorldPosition(float longitudeDegrees, float latitudeDegrees);
 
103
        
 
104
protected:
 
105
        Ogre::SceneManager *mSceneMgr;
 
106
        Ogre::RenderWindow* mWindow;
 
107
        Ogre::Camera& mCamera;
 
108
        
 
109
        SimpleSun* mSun;
 
110
        SimpleSky* mSky;
 
111
        SimpleFog* mFog;
 
112
        IWater* mWater;
 
113
 
 
114
};
 
115
 
 
116
}
 
117
 
 
118
}
 
119
 
 
120
#endif