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

« back to all changes in this revision

Viewing changes to src/components/ogre/environment/caelum/include/SolarSystemModel.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-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 SOLARSYSTEMMODEL_H
 
22
#define SOLARSYSTEMMODEL_H
 
23
 
 
24
#include "CaelumPrerequisites.h"
 
25
 
 
26
namespace caelum
 
27
{
 
28
    /** Class which calculates sun and moon positions on the sky.
 
29
     *  Most of the calculations are done in the astronomy class.
 
30
     */
 
31
    class CAELUM_EXPORT SolarSystemModel
 
32
    {
 
33
    private:
 
34
        Ogre::Degree mObserverLatitude;
 
35
        Ogre::Degree mObserverLongitude;
 
36
 
 
37
        static const Ogre::Vector3 makeDirection (
 
38
                Ogre::Degree azimuth, Ogre::Degree altitude);
 
39
 
 
40
        public:
 
41
                /** Constructor, initializes observer's position on earth.
 
42
                 */
 
43
        SolarSystemModel (
 
44
                Ogre::Degree longitude = Ogre::Degree (0),
 
45
                Ogre::Degree latitude = Ogre::Degree (45));
 
46
                
 
47
        /// Get the observer's longitude. East is positive, west is negative.
 
48
        inline const Ogre::Degree getObserverLongitude () const { return mObserverLongitude; }
 
49
 
 
50
        /// Set the observer's longitude. East is positive, west is negative.
 
51
        inline void setObserverLongitude (Ogre::Degree value) { mObserverLongitude = value; }
 
52
 
 
53
        /// Get the observer's latitude. North is positive, south is negative.
 
54
        inline const Ogre::Degree getObserverLatitude () const { return mObserverLatitude; }
 
55
 
 
56
        /// Set the observer's latitude. North is positive, south is negative.
 
57
        inline void setObserverLatitude (Ogre::Degree value) { mObserverLatitude = value; }
 
58
 
 
59
                /** Get the sun's direction at a certain time.
 
60
         *  @param jday astronomical julian day.
 
61
         *  @see UniversalClock for julian day calculations.
 
62
                 */
 
63
                const Ogre::Vector3 getSunDirection (LongReal jday);
 
64
 
 
65
                /** Get the moon's direction at a certain time.
 
66
         *  @param jday astronomical julian day.
 
67
                 */
 
68
                const Ogre::Vector3 getMoonDirection (LongReal jday);
 
69
 
 
70
        /** Fake function to get the phase of the moon
 
71
         *  @param jday Julian day
 
72
         *  @return the phase of the moon; ranging from 0(full moon) to 2(new moon).
 
73
         *  The calculations performed by this function are completely fake.
 
74
         *  It's a triangle wave with a period of 28.5 days.
 
75
         */
 
76
                const Ogre::Real getMoonPhase (LongReal jday);
 
77
    };
 
78
}
 
79
 
 
80
#endif // SOLARSYSTEMMODEL_H