# include <sys/time.h> // for get/setitimer, gettimeofday, struct timeval
#endif
-#include <Astro/orbits.hxx>
-#include <Astro/sun.hxx>
+//#include <Astro/orbits.hxx>
+//#include <Astro/sun.hxx>
#include <Astro/sky.hxx>
+#include <Astro/solarsystem.hxx>
#include <Debug/fg_debug.h>
#include <Flight/flight.h>
#include <Include/fg_constants.h>
// Force an update of the sky and lighting parameters
static void local_update_sky_and_lighting_params( void ) {
- fgSunInit();
+ // fgSunInit();
+ SolarSystem::theSolarSystem->rebuild();
cur_light_params.Update();
fgSkyColorsInit();
}
// $Log$
+// Revision 1.17 1998/09/15 04:27:49 curt
+// Changes for new astro code.
+//
// Revision 1.16 1998/08/29 13:11:32 curt
// Bernie Bright writes:
// I've created some new classes to enable pointers-to-functions and
#include <stdio.h>
#include <time.h>
-#include <Astro/orbits.hxx>
+//#include <Astro/orbits.hxx>
+#include <Astro/solarsystem.hxx>
#include <Include/fg_constants.h>
#include <Main/views.hxx>
#include <Math/fg_geodesy.h>
#include "fg_time.hxx"
#include "sunpos.hxx"
+extern SolarSystem *solarSystem;
#undef E
/* 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 (solarPosition.lonSun, 0.0, &alpha, &delta);
+
+ /* **********************************************************************
+ * NOTE: in the next function, each time the sun's position is updated, the
+ * the sun's longitude is returned from solarSystem->sun. Note that the
+ * sun's position is updated at a much higher frequency than the rate at
+ * which the solar system's rebuilds occur. This is not a problem, however,
+ * because the fgSunPosition we're talking about here concerns the changing
+ * position of the sun due to the daily rotation of the earth.
+ * The ecliptic longitude, however, represents the position of the sun with
+ * respect to the stars, and completes just one cycle over the course of a
+ * year. Its therefore pretty safe to update the sun's longitude only once
+ * every ten minutes. (Comment added by Durk Talsma).
+ ************************************************************************/
+
+ ecliptic_to_equatorial( SolarSystem::theSolarSystem->getSun()->getLon(),
+ 0.0, &alpha, &delta );
tmp = alpha - (FG_2PI/24)*GST(ssue);
if (tmp < -FG_PI) {
do tmp += FG_2PI;
/* 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 (solarPosition.lonSun, 0.0, &alpha, &delta);
+ ecliptic_to_equatorial( SolarSystem::theSolarSystem->getSun()->getLon(),
+ 0.0, &alpha, &delta );
// tmp = alpha - (FG_2PI/24)*GST(ssue);
tmp = alpha - (FG_2PI/24)*gst;
// $Log$
+// Revision 1.12 1998/09/15 04:27:50 curt
+// Changes for new astro code.
+//
// Revision 1.11 1998/08/12 21:13:22 curt
// Optimizations by Norman Vine.
//