// Constructor
-FGEphemeris::FGEphemeris( void ) {
+FGEphemeris::FGEphemeris( const string &path ) {
+ our_sun = new Star;
+ moon = new Moon;
+ mercury = new Mercury;
+ venus = new Venus;
+ mars = new Mars;
+ jupiter = new Jupiter;
+ saturn = new Saturn;
+ uranus = new Uranus;
+ neptune = new Neptune;
+ stars = new FGStars( FGPath(path) );
}
// Destructor
FGEphemeris::~FGEphemeris( void ) {
+ delete our_sun;
+ delete moon;
+ delete mercury;
+ delete venus;
+ delete mars;
+ delete jupiter;
+ delete saturn;
+ delete uranus;
+ delete neptune;
+ delete stars;
}
// Update (recalculate) the positions of all objects for the specified
// time
-void FGEphemeris::update( FGTime *t ) {
- our_sun.updatePosition( t );
+void FGEphemeris::update( FGTime *t, double lat ) {
+ // update object positions
+ our_sun->updatePosition( t );
+ moon->updatePosition( t, lat, our_sun );
+ mercury->updatePosition( t, our_sun );
+ venus->updatePosition( t, our_sun );
+ mars->updatePosition( t, our_sun );
+ jupiter->updatePosition( t, our_sun );
+ saturn->updatePosition( t, our_sun );
+ uranus->updatePosition( t, our_sun );
+ neptune->updatePosition( t, our_sun );
+
+ // update planets list
+ nplanets = 7;
+ mercury->getPos( &planets[0][0], &planets[0][1], &planets[0][2] );
+ venus ->getPos( &planets[1][0], &planets[1][1], &planets[1][2] );
+ mars ->getPos( &planets[2][0], &planets[2][1], &planets[2][2] );
+ jupiter->getPos( &planets[3][0], &planets[3][1], &planets[3][2] );
+ saturn ->getPos( &planets[4][0], &planets[4][1], &planets[4][2] );
+ uranus ->getPos( &planets[5][0], &planets[5][1], &planets[5][2] );
+ neptune->getPos( &planets[6][0], &planets[6][1], &planets[6][2] );
}