]> git.mxchange.org Git - simgear.git/blobdiff - simgear/ephemeris/ephemeris.cxx
Migrated this source over to SimGear.
[simgear.git] / simgear / ephemeris / ephemeris.cxx
index c795a8584100139be4f0b2bcf0cad2504d300423..957556f9bbc44df434c0f112cb0f5f47530c3312 100644 (file)
@@ -26,7 +26,7 @@
 
 
 // Constructor
-FGEphemeris::FGEphemeris( void ) {
+FGEphemeris::FGEphemeris( const string &path ) {
     our_sun = new Star;
     moon = new Moon;
     mercury = new Mercury;
@@ -36,6 +36,7 @@ FGEphemeris::FGEphemeris( void ) {
     saturn = new Saturn;
     uranus = new Uranus;
     neptune = new Neptune;
+    stars = new FGStars( FGPath(path) );
 }
 
 
@@ -50,15 +51,16 @@ FGEphemeris::~FGEphemeris( void ) {
     delete saturn;
     delete uranus;
     delete neptune;
+    delete stars;
 }
 
 
 // Update (recalculate) the positions of all objects for the specified
 // time
-void FGEphemeris::update( FGTime *t ) {
+void FGEphemeris::update( FGTime *t, double lat ) {
     // update object positions
     our_sun->updatePosition( t );
-    moon->updatePosition( t, our_sun );
+    moon->updatePosition( t, lat, our_sun );
     mercury->updatePosition( t, our_sun );
     venus->updatePosition( t, our_sun );
     mars->updatePosition( t, our_sun );
@@ -68,6 +70,7 @@ void FGEphemeris::update( FGTime *t ) {
     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] );
@@ -75,6 +78,5 @@ void FGEphemeris::update( FGTime *t ) {
     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] );
-    
 }