#include <simgear/constants.h> // for VERSION
#include <simgear/debug/logstream.hxx>
-#include <simgear/ephemeris/ephemeris.hxx>
#include <simgear/math/fg_geodesy.hxx>
#include <simgear/math/polar3d.hxx>
#include <simgear/math/fg_random.h>
FGInterface cur_view_fdm;
// Sky structures
-FGEphemeris *ephem;
SGSky *thesky;
// hack
cur_light_params.adj_fog_color,
cur_light_params.sun_angle,
cur_light_params.moon_angle,
- ephem->getNumPlanets(), ephem->getPlanets(),
- ephem->getNumStars(), ephem->getStars() );
+ globals->get_ephem()->getNumPlanets(),
+ globals->get_ephem()->getPlanets(),
+ globals->get_ephem()->getNumStars(),
+ globals->get_ephem()->getStars() );
/* cout << "thesky->reposition( view_pos = " << view_pos[0] << " "
<< view_pos[1] << " " << view_pos[2] << endl;
<< " lat = " << cur_fdm_state->get_Latitude() << endl;
cout << " sun_rot = " << cur_light_params.sun_rotation
<< " gst = " << SGTime::cur_time_params->getGst() << endl;
- cout << " sun ra = " << ephem->getSunRightAscension()
- << " sun dec = " << ephem->getSunDeclination()
- << " moon ra = " << ephem->getMoonRightAscension()
- << " moon dec = " << ephem->getMoonDeclination() << endl; */
+ cout << " sun ra = " << globals->get_ephem()->getSunRightAscension()
+ << " sun dec = " << globals->get_ephem()->getSunDeclination()
+ << " moon ra = " << globals->get_ephem()->getMoonRightAscension()
+ << " moon dec = " << globals->get_ephem()->getMoonDeclination() << endl; */
thesky->reposition( view_pos, zero_elev,
current_view.get_local_up(),
cur_fdm_state->get_Altitude() * FEET_TO_METER,
cur_light_params.sun_rotation,
globals->get_time_params()->getGst(),
- ephem->getSunRightAscension(),
- ephem->getSunDeclination(), 50000.0,
- ephem->getMoonRightAscension(),
- ephem->getMoonDeclination(), 50000.0 );
+ globals->get_ephem()->getSunRightAscension(),
+ globals->get_ephem()->getSunDeclination(),
+ 50000.0,
+ globals->get_ephem()->getMoonRightAscension(),
+ globals->get_ephem()->getMoonDeclination(),
+ 50000.0 );
}
glEnable( GL_DEPTH_TEST );
l->UpdateAdjFog();
// Update solar system
- ephem->update( globals->get_time_params(), cur_fdm_state->get_Latitude() );
+ globals->get_ephem()->update( globals->get_time_params()->getMjd(),
+ globals->get_time_params()->getLst(),
+ cur_fdm_state->get_Latitude() );
// Update radio stack model
current_radiostack->update( cur_fdm_state->get_Longitude(),
// Initialize the sky
FGPath ephem_data_path( current_options.get_fg_root() );
ephem_data_path.append( "Astro" );
- ephem = new FGEphemeris( ephem_data_path.c_str() );
- ephem->update( globals->get_time_params(), 0.0 );
+ SGEphemeris *ephem = new SGEphemeris( ephem_data_path.c_str() );
+ ephem->update( globals->get_time_params()->getMjd(),
+ globals->get_time_params()->getLst(),
+ 0.0 );
+ globals->set_ephem( ephem );
FGPath sky_tex_path( current_options.get_fg_root() );
sky_tex_path.append( "Textures" );
thesky->texture_path( sky_tex_path.str() );
thesky->build( 550.0, 550.0,
- ephem->getNumPlanets(),
- ephem->getPlanets(), 60000.0,
- ephem->getNumStars(),
- ephem->getStars(), 60000.0 );
+ globals->get_ephem()->getNumPlanets(),
+ globals->get_ephem()->getPlanets(), 60000.0,
+ globals->get_ephem()->getNumStars(),
+ globals->get_ephem()->getStars(), 60000.0 );
thesky->add_cloud_layer( 2600.0, 200.0, 50.0, 40000.0,
SG_CLOUD_MOSTLY_SUNNY );
#include "moonpos.hxx"
-// extern SolarSystem *solarSystem;
-extern FGEphemeris *ephem;
-
#undef E
* every ten minutes. (Comment added by Durk Talsma).
************************************************************************/
- ecliptic_to_equatorial( ephem->get_moon()->getLon(),
+ ecliptic_to_equatorial( globals->get_ephem()->get_moon()->getLon(),
0.0, &alpha, &delta );
tmp = alpha - (FG_2PI/24)*GST(ssue);
if (tmp < -FG_PI) {
/* lambda = moon_ecliptic_longitude(ssue); */
/* ecliptic_to_equatorial(lambda, 0.0, &alpha, &delta); */
//ecliptic_to_equatorial (solarPosition.lonMoon, 0.0, &alpha, &delta);
- ecliptic_to_equatorial( ephem->get_moon()->getLon(),
- ephem->get_moon()->getLat(),
+ ecliptic_to_equatorial( globals->get_ephem()->get_moon()->getLon(),
+ globals->get_ephem()->get_moon()->getLat(),
&alpha, &delta );
// tmp = alpha - (FG_2PI/24)*GST(ssue);
#include "sunpos.hxx"
-// extern SolarSystem *solarSystem;
-extern FGEphemeris *ephem;
-
#undef E
#define MeanObliquity (23.440592*(FG_2PI/360))
* every ten minutes. (Comment added by Durk Talsma).
************************************************************************/
- ecliptic_to_equatorial( ephem->get_sun()->getLon(),
+ ecliptic_to_equatorial( globals->get_ephem()->get_sun()->getLon(),
0.0, &alpha, &delta );
tmp = alpha - (FG_2PI/24)*GST(ssue);
if (tmp < -FG_PI) {
/* lambda = sun_ecliptic_longitude(ssue); */
/* ecliptic_to_equatorial(lambda, 0.0, &alpha, &delta); */
//ecliptic_to_equatorial (solarPosition.lonSun, 0.0, &alpha, &delta);
- ecliptic_to_equatorial( ephem->get_sun()->getLon(),
- ephem->get_sun()->getLat(),
+ ecliptic_to_equatorial( globals->get_ephem()->get_sun()->getLon(),
+ globals->get_ephem()->get_sun()->getLat(),
&alpha, &delta );
// tmp = alpha - (FG_2PI/24)*GST(ssue);