#include <simgear/math/vector.hxx>
#include <Main/globals.hxx>
+#include <Main/viewer.hxx>
#include <Scenery/scenery.hxx>
#include <Time/light.hxx>
// update the cur_time_params structure with the current moon position
void fgUpdateMoonPos( void ) {
fgLIGHT *l;
- FGViewerRPH *v;
+ FGViewer *v;
sgVec3 nup, nmoon;
Point3D p, rel_moonpos;
double dot, east_dot;
l = &cur_light_params;
SGTime *t = globals->get_time_params();
- v = (FGViewerRPH *)globals->get_current_view();
+ v = globals->get_current_view();
SG_LOG( SG_EVENT, SG_INFO, " Updating Moon position" );
Point3D vp( v->get_view_pos()[0],
v->get_view_pos()[1],
v->get_view_pos()[2] );
- rel_moonpos = l->fg_moonpos - ( vp + scenery.center );
+ rel_moonpos = l->fg_moonpos - ( vp + scenery.get_center() );
sgSetVec3( to_moon, rel_moonpos.x(), rel_moonpos.y(), rel_moonpos.z() );
// printf( "Vector to moon = %.2f %.2f %.2f\n",
// to_moon[0], to_moon[1], to_moon[2]);