]> git.mxchange.org Git - flightgear.git/blobdiff - src/Time/moonpos.cxx
Updates to allow weather system and atis to interact better.
[flightgear.git] / src / Time / moonpos.cxx
index 8cac8cafdffb35566cab2ec8cd3809a67e9627c2..1818cdd53623d3148405ee2770ab519a335eebd9 100644 (file)
@@ -61,6 +61,7 @@
 #include <simgear/math/vector.hxx>
 
 #include <Main/globals.hxx>
+#include <Main/viewer.hxx>
 #include <Scenery/scenery.hxx>
 #include <Time/light.hxx>
 
@@ -335,7 +336,7 @@ static void fgMoonPositionGST(double gst, double *lon, double *lat) {
 // 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;
@@ -350,7 +351,7 @@ void fgUpdateMoonPos( void ) {
 
     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" );
 
@@ -398,7 +399,7 @@ void fgUpdateMoonPos( void ) {
     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]);