2
This file is part of Caelum.
3
See http://www.ogre3d.org/wiki/index.php/Caelum
5
Copyright (c) 2006-2008 Caelum team. See Contributors.txt for details.
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.
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.
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/>.
21
#ifndef SOLARSYSTEMMODEL_H
22
#define SOLARSYSTEMMODEL_H
24
#include "CaelumPrerequisites.h"
28
/** Class which calculates sun and moon positions on the sky.
29
* Most of the calculations are done in the astronomy class.
31
class CAELUM_EXPORT SolarSystemModel
34
Ogre::Degree mObserverLatitude;
35
Ogre::Degree mObserverLongitude;
37
static const Ogre::Vector3 makeDirection (
38
Ogre::Degree azimuth, Ogre::Degree altitude);
41
/** Constructor, initializes observer's position on earth.
44
Ogre::Degree longitude = Ogre::Degree (0),
45
Ogre::Degree latitude = Ogre::Degree (45));
47
/// Get the observer's longitude. East is positive, west is negative.
48
inline const Ogre::Degree getObserverLongitude () const { return mObserverLongitude; }
50
/// Set the observer's longitude. East is positive, west is negative.
51
inline void setObserverLongitude (Ogre::Degree value) { mObserverLongitude = value; }
53
/// Get the observer's latitude. North is positive, south is negative.
54
inline const Ogre::Degree getObserverLatitude () const { return mObserverLatitude; }
56
/// Set the observer's latitude. North is positive, south is negative.
57
inline void setObserverLatitude (Ogre::Degree value) { mObserverLatitude = value; }
59
/** Get the sun's direction at a certain time.
60
* @param jday astronomical julian day.
61
* @see UniversalClock for julian day calculations.
63
const Ogre::Vector3 getSunDirection (LongReal jday);
65
/** Get the moon's direction at a certain time.
66
* @param jday astronomical julian day.
68
const Ogre::Vector3 getMoonDirection (LongReal jday);
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.
76
const Ogre::Real getMoonPhase (LongReal jday);
80
#endif // SOLARSYSTEMMODEL_H