parallax.
// 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 );
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] );
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] );
-
}
Uranus *uranus;
Neptune *neptune;
- // 9 planets - earth - pluto which we don't draw = 7
+ // 9 planets, minus earth, minus pluto which we don't draw = 7
// planets[i][0] = Right Ascension
// planets[i][1] = Declination
// planets[i][2] = Magnitude
+ int nplanets;
sgdVec3 planets[7];
-
+
public:
// Constructor
// Update (recalculate) the positions of all objects for the
// specified time
- void update(FGTime *t);
+ void update(FGTime *t, double lat);
- // sun position
+ // sun
+ inline Star *get_sun() const { return our_sun; }
inline double getSunRightAscension() const {
return our_sun->getRightAscension();
}
return our_sun->getDeclination();
}
- // moon position
+ // moon
+ inline Moon *get_moon() const { return moon; }
inline double getMoonRightAscension() const {
return moon->getRightAscension();
}
}
// planets
- inline sgdVec3 *getPlanets() const {
- return planets;
- }
+ inline int getNumPlanets() const { return nplanets; }
+ inline sgdVec3 *getPlanets() { return planets; }
};
* the position of the moon as seen from the current position on the surface
* of the moon.
****************************************************************************/
-void Moon::updatePosition(FGTime *t, Star *ourSun)
+void Moon::updatePosition(FGTime *t, double lat, Star *ourSun)
{
double
eccAnom, ecl, actTime,
// FG_LOG( FG_GENERAL, FG_INFO, "r = " << r << " mpar = " << mpar );
// FG_LOG( FG_GENERAL, FG_INFO, "lat = " << f->get_Latitude() );
- gclat = f->get_Latitude() - 0.003358 *
- sin (2 * DEG_TO_RAD * f->get_Latitude() );
+ gclat = lat - 0.003358 *
+ sin (2 * DEG_TO_RAD * lat );
// FG_LOG( FG_GENERAL, FG_INFO, "gclat = " << gclat );
- rho = 0.99883 + 0.00167 * cos(2 * DEG_TO_RAD * f->get_Latitude());
+ rho = 0.99883 + 0.00167 * cos(2 * DEG_TO_RAD * lat);
// FG_LOG( FG_GENERAL, FG_INFO, "rho = " << rho );
if (geoRa < 0)
Moon( FGTime *t);
Moon();
~Moon();
- void updatePosition(FGTime *t, Star *ourSun);
+ void updatePosition(FGTime *t, double lat, Star *ourSun);
// void newImage();
};
// solar eclipse. This is yet untested though...
// Euhh, actually the ecplise doesn't work...
- earthsMoon->newImage();
+ // earthsMoon->newImage();
// Step 2b: Add the sun
// ourSun->newImage();
// Step 2c: Add the planets
void updatePosition(FGTime *t);
double getM();
double getw();
- //double getLon();
double getxs();
double getys();
double getDistance();