]> git.mxchange.org Git - flightgear.git/blobdiff - src/Time/sunpos.cxx
Patch from Cameron Moore:
[flightgear.git] / src / Time / sunpos.cxx
index c436b1b7d25b8089523c007f3f5c905f595a309c..ebc45f9d5f3dc50219e928712b0c101145d68660 100644 (file)
@@ -60,6 +60,7 @@
 #include <simgear/math/polar3d.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/math/vector.hxx>
+#include <simgear/timing/sg_time.hxx>
 
 #include <Main/globals.hxx>
 #include <Main/viewer.hxx>
@@ -306,7 +307,7 @@ void fgUpdateSunPos( void ) {
     Point3D vp( v->get_view_pos()[0],
                v->get_view_pos()[1],
                v->get_view_pos()[2] );
-    rel_sunpos = l->fg_sunpos - ( vp + scenery.get_center() );
+    rel_sunpos = l->fg_sunpos - ( vp + globals->get_scenery()->get_center() );
     sgSetVec3( to_sun, rel_sunpos.x(), rel_sunpos.y(), rel_sunpos.z() );
     // printf( "Vector to sun = %.2f %.2f %.2f\n",
     //         v->to_sun[0], v->to_sun[1], v->to_sun[2]);