Pass star and planet data to Sky module.
#include <Controls/controls.hxx>
#include <Autopilot/autopilot.hxx>
#include <Time/fg_time.hxx>
-#include <Astro/solarsystem.hxx>
+#include <Time/light.hxx>
#ifndef FG_OLD_WEATHER
# include <WeatherCM/FGLocalWeatherDatabase.h>
#else
double gpsLongitude = getGPSTargetLongitude();
fgReInitSubsystems();
- solarSystemRebuild();
+ // solarSystemRebuild();
cur_light_params.Update();
// Restore all of the old states.
#include <Aircraft/aircraft.hxx>
#include <Airports/simple.hxx>
#include <Astro/stars.hxx>
-#include <Astro/solarsystem.hxx>
#include <Autopilot/autopilot.hxx>
#include <Cockpit/cockpit.hxx>
#include <FDM/Balloon.h>
FG_LOG( FG_GENERAL, FG_DEBUG, " abs_view_pos = " << current_view.get_abs_view_pos());
// current_view.UpdateWorldToEye(f);
- // Build the solar system
- //fgSolarSystemInit(*t);
- FG_LOG(FG_GENERAL, FG_INFO, "Building SolarSystem");
- SolarSystem::theSolarSystem = new SolarSystem(t);
-
- // Initialize the Stars subsystem
- if( fgStarsInit() ) {
- // Stars initialized ok.
- } else {
- FG_LOG( FG_GENERAL, FG_ALERT, "Error in Stars initialization!" );
- exit(-1);
- }
-
// Initialize the planetary subsystem
// global_events.Register( "fgPlanetsInit()", fgPlanetsInit,
// fgEVENT::FG_EVENT_READY, 600000);
// global_events.Register( "fgMoonInit()", fgMoonInit,
// fgEVENT::FG_EVENT_READY, 600000 );
- // register the periodic update of Sun, moon, and planets
- global_events.Register( "ssolsysUpdate", solarSystemRebuild,
- fgEVENT::FG_EVENT_READY, 600000);
-
// fgUpdateSunPos() needs a few position and view parameters set
// so it can calculate local relative sun angle and a few other
// things for correctly orienting the sky.
#include <Aircraft/aircraft.hxx>
#include <Astro/ephemeris.hxx>
-#include <Astro/stars.hxx>
-#include <Astro/solarsystem.hxx>
#include <Autopilot/autopilot.hxx>
#include <Cockpit/cockpit.hxx>
cur_light_params.fog_color,
cur_light_params.sun_angle,
cur_light_params.moon_angle,
- 0, NULL, 0, NULL );
-
+ ephem->getNumPlanets(), ephem->getPlanets(),
+ ephem->getNumStars(), ephem->getStars() );
+
/* cout << "thesky->reposition( view_pos = " << view_pos[0] << " "
<< view_pos[1] << " " << view_pos[2] << endl;
cout << " zero_elev = " << zero_elev[0] << " "
// yes we've finished all our initializations and are running
// the main loop, so this will now work without seg faulting
// the system.
- solarSystemRebuild();
current_view.UpdateViewParams(cur_view_fdm);
if ( current_options.get_panel_status() ) {
FGPanel::OurPanel->ReInit(0, 0, 1024, 768);
scene->setName( "Scene" );
// Initialize the sky
- ephem = new FGEphemeris;
+ FGPath ephem_data_path( current_options.get_fg_root() );
+ ephem_data_path.append( "Astro" );
+ ephem = new FGEphemeris( ephem_data_path.c_str() );
ephem->update( FGTime::cur_time_params, 0.0 );
+
FGPath sky_tex_path( current_options.get_fg_root() );
sky_tex_path.append( "Textures" );
sky_tex_path.append( "Sky" );
thesky = new SGSky;
thesky->texture_path( sky_tex_path.str() );
+
ssgBranch *sky = thesky->build( 550.0, 550.0,
ephem->getNumPlanets(),
ephem->getPlanets(), 60000.0,
- 0, NULL, 60000.0 );
+ ephem->getNumStars(),
+ ephem->getStars(), 60000.0 );
scene->addKid( sky );
// Terrain branch