]> git.mxchange.org Git - simgear.git/blob - simgear/ephemeris/ephemeris.hxx
Complete overhaul of the sky/sun/moon/stars/planets. It is now an ssg
[simgear.git] / simgear / ephemeris / ephemeris.hxx
1 // ephemeris.hxx -- Top level class for calculating current positions of
2 //                  astronomical objects
3 //
4 // Written by Curtis Olson, started March 2000.
5 //
6 // Copyright (C) 2000  Curtis L. Olson - curt@flightgear.org
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 //
22 // $Id$
23
24
25 #ifndef _EPHEMERIS_HXX
26 #define _EPHEMERIS_HXX
27
28
29 #include <plib/sg.h>
30
31 #include <Time/fg_time.hxx>
32
33 #include "star.hxx"
34 #include "moon.hxx"
35 #include "mercury.hxx"
36 #include "venus.hxx"
37 #include "mars.hxx"
38 #include "jupiter.hxx"
39 #include "saturn.hxx"
40 #include "uranus.hxx"
41 #include "neptune.hxx"
42
43
44 class FGEphemeris {
45
46     Star *our_sun;
47     Moon *moon;
48     Mercury *mercury;
49     Venus *venus;
50     Mars *mars;
51     Jupiter *jupiter;
52     Saturn *saturn;
53     Uranus *uranus;
54     Neptune *neptune;
55
56     // 9 planets, minus earth, minus pluto which we don't draw = 7
57     // planets[i][0] = Right Ascension
58     // planets[i][1] = Declination
59     // planets[i][2] = Magnitude
60     int nplanets;
61     sgdVec3 planets[7];
62     
63 public:
64
65     // Constructor
66     FGEphemeris( void );
67
68     // Destructor
69     ~FGEphemeris( void );
70
71     // Update (recalculate) the positions of all objects for the
72     // specified time
73     void update(FGTime *t, double lat);
74
75     // sun
76     inline Star *get_sun() const { return our_sun; }
77     inline double getSunRightAscension() const {
78         return our_sun->getRightAscension();
79     }
80     inline double getSunDeclination() const {
81         return our_sun->getDeclination();
82     }
83
84     // moon
85     inline Moon *get_moon() const { return moon; }
86     inline double getMoonRightAscension() const {
87         return moon->getRightAscension();
88     }
89     inline double getMoonDeclination() const {
90         return moon->getDeclination();
91     }
92
93     // planets
94     inline int getNumPlanets() const { return nplanets; }
95     inline sgdVec3 *getPlanets() { return planets; }
96 };
97
98
99 #endif // _EPHEMERIS_HXX
100
101