#include <Aircraft/aircraft.hxx>
#include <Astro/solarsystem.hxx>
-// #include <Astro/skydome.hxx>
#include <Autopilot/autopilot.hxx>
#include <Cockpit/hud.hxx>
#include <GUI/gui.h>
// fgSunInit();
SolarSystem::theSolarSystem->rebuild();
cur_light_params.Update();
- /* current_sky.repaint( cur_light_params.sky_color,
- cur_light_params.fog_color,
- cur_light_params.sun_angle ); */
}
#include <Include/general.hxx>
#include <Aircraft/aircraft.hxx>
+#include <Astro/ephemeris.hxx>
#include <Astro/stars.hxx>
#include <Astro/solarsystem.hxx>
#include <Scenery/scenery.hxx>
#include <Scenery/tilemgr.hxx>
#include <Sky/skydome.hxx>
-#include <Sky/sphere.hxx>
+#include <Sky/skysun.hxx>
#include <Time/event.hxx>
#include <Time/fg_time.hxx>
#include <Time/fg_timer.hxx>
// current fdm/position used for view
FGInterface cur_view_fdm;
+// Sky structures
+FGEphemeris ephem;
+FGSkyDome current_sky;
+FGSkySun current_sun;
+
// hack
sgMat4 copy_of_ssgOpenGLAxisSwapMatrix =
{
// set the opengl state to known default values
default_state->force();
- // draw sky
xglDisable( GL_DEPTH_TEST );
xglDisable( GL_FOG );
- // xglDisable( GL_TEXTURE_2D );
- // xglDisable( GL_LIGHTING );
- // xglDisable( GL_CULL_FACE );
- // xglShadeModel( GL_SMOOTH );
-
- /* if ( current_options.get_fog() > 0 ) {
- xglEnable( GL_FOG );
- xglFogi( GL_FOG_MODE, GL_EXP2 );
- xglFogfv( GL_FOG_COLOR, l->adj_fog_color );
- } */
-
+ // draw sky dome
if ( current_options.get_skyblend() ) {
- // fgSkyRender();
-
sgVec3 zero_elev;
sgSetVec3( zero_elev,
current_view.get_cur_zero_elev().x(),
cur_fdm_state->get_Latitude(),
cur_light_params.sun_rotation );
- xglPushMatrix();
-
current_sky.draw();
-
- xglPopMatrix();
}
+ // draw the sun
+ current_sun.repaint( cur_light_params.sun_angle );
+ cout << "ra = " << ephem.getSunRightAscension() << " dec = "
+ << ephem.getSunDeclination() << endl;
+ current_sun.reposition( ephem.getSunRightAscension(),
+ ephem.getSunDeclination() );
+ current_sun.draw();
+
// xglDisable( GL_FOG );
/*
}
# endif
- ssgSetCamera( current_view.VIEW );
+ // ssgSetCamera( current_view.VIEW );
// position tile nodes and update range selectors
global_tile_mgr.prep_ssg_nodes();
FG_Psi * RAD_TO_DEG, current_view.view_offset * RAD_TO_DEG,
-(l->sun_rotation+FG_PI) * RAD_TO_DEG, tmp * RAD_TO_DEG); */
l->UpdateAdjFog();
+
+ // Update solar system
+ ephem.update( t );
}
// Initialize the sky
current_sky.initialize();
+ current_sun.initialize();
// temporary visible aircraft "own ship"
penguin_sel = new ssgSelector;
penguin_pos = new ssgTransform;
- ssgBranch *tux_obj = ssgMakeSphere( 10.0, 10, 10 );
- // ssgEntity *tux_obj = ssgLoadAC( "glider.ac" );
+ // ssgBranch *tux_obj = ssgMakeSphere( 10.0, 10, 10 );
+ ssgEntity *tux_obj = ssgLoadAC( "glider.ac" );
// ssgEntity *tux_obj = ssgLoadAC( "Tower1x.ac" );
penguin_pos->addKid( tux_obj );