X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FTime%2Fsunpos.cxx;h=900f502c0c3f0107c731a57897e16e922e7c34ea;hb=cf6022e43937bc19dc97885fb8248e67e69b6ad8;hp=53457aed8218b7d67628d36828e87b8da6e17658;hpb=0175b4cd253a69f22cc28f8f42fc019af26641e5;p=flightgear.git diff --git a/src/Time/sunpos.cxx b/src/Time/sunpos.cxx index 53457aed8..900f502c0 100644 --- a/src/Time/sunpos.cxx +++ b/src/Time/sunpos.cxx @@ -251,7 +251,7 @@ void fgUpdateSunPos( void ) { l = &cur_light_params; SGTime *t = globals->get_time_params(); - v = globals->get_current_view(); + v = (FGViewerRPH *)globals->get_current_view(); FG_LOG( FG_EVENT, FG_INFO, " Updating Sun position" ); FG_LOG( FG_EVENT, FG_INFO, " Gst = " << t->getGst() ); @@ -281,7 +281,7 @@ void fgUpdateSunPos( void ) { // << ","<< l->sun_vec[2] << endl; // calculate the sun's relative angle to local up - sgCopyVec3( nup, v->get_local_up() ); + sgCopyVec3( nup, v->get_world_up() ); sgSetVec3( nsun, l->fg_sunpos.x(), l->fg_sunpos.y(), l->fg_sunpos.z() ); sgNormalizeVec3(nup); sgNormalizeVec3(nsun); @@ -306,7 +306,7 @@ void fgUpdateSunPos( void ) { // earth's surface the sun is directly over, map into onto the // local plane representing "horizontal". - sgmap_vec_onto_cur_surface_plane( v->get_local_up(), v->get_view_pos(), + sgmap_vec_onto_cur_surface_plane( v->get_world_up(), v->get_view_pos(), v->get_to_sun(), surface_to_sun ); sgNormalizeVec3(surface_to_sun); v->set_surface_to_sun( surface_to_sun[0], surface_to_sun[1],