X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FLaRCsimIC.cxx;h=5ec1db499a3021e9e5e7261e87d5a5e307d97797;hb=9c0925744d27363955b3f26caf3311bc0a91ea69;hp=9b00c3b584075dd26e3af9055cf60fa2c03490c2;hpb=7cc98ad15f7295cc3665abe6a0d419bf84ada3ac;p=flightgear.git diff --git a/src/FDM/LaRCsimIC.cxx b/src/FDM/LaRCsimIC.cxx index 9b00c3b58..5ec1db499 100644 --- a/src/FDM/LaRCsimIC.cxx +++ b/src/FDM/LaRCsimIC.cxx @@ -25,6 +25,11 @@ */ +#include + +#include +#include STL_IOSTREAM + #include "FDM/LaRCsimIC.hxx" #include #include @@ -32,8 +37,12 @@ #include #include #include -#include -#include + +#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS) +SG_USING_STD(cout); +SG_USING_STD(endl); +#endif + LaRCsimIC::LaRCsimIC(void) { vt=vtg=vw=vc=ve=0; @@ -97,7 +106,7 @@ void LaRCsimIC::SetClimbRateFpsIC( SCALAR tt) { getTheta(); vdown=-1*hdot; cout << "hdot: " << hdot << endl; - cout << "gamma: " << gamma*RAD_TO_DEG << endl; + cout << "gamma: " << gamma*SGD_RADIANS_TO_DEGREES << endl; cout << "vdown: " << vdown << endl; } } @@ -119,40 +128,18 @@ void LaRCsimIC::SetPitchAngleRadIC(SCALAR tt) { getAlpha(); } -void LaRCsimIC::SetUBodyFpsIC( SCALAR tt) { - u=tt; +void LaRCsimIC::SetUVWFpsIC(SCALAR vu, SCALAR vv, SCALAR vw) { + u=vu; v=vv; w=vw; vt=sqrt(u*u+v*v+w*w); lastSpeedSet=lssetuvw; } -void LaRCsimIC::SetVBodyFpsIC( SCALAR tt) { - v=tt; - vt=sqrt(u*u+v*v+w*w); - lastSpeedSet=lssetuvw; -} - -void LaRCsimIC::SetWBodyFpsIC( SCALAR tt) { - w=tt; - vt=sqrt(u*u+v*v+w*w); - lastSpeedSet=lssetuvw; -} - -void LaRCsimIC::SetVNorthAirmassFpsIC(SCALAR tt) { - vnorthwind=tt; - vw=sqrt(vnorthwind*vnorthwind + veastwind*veastwind + vdownwind*vdownwind); -} - -void LaRCsimIC::SetVEastAirmassFpsIC(SCALAR tt) { - veastwind=tt; - vw=sqrt(vnorthwind*vnorthwind + veastwind*veastwind + vdownwind*vdownwind); -} - -void LaRCsimIC::SetVDownAirmassFpsIC(SCALAR tt){ - vdownwind=tt; +void LaRCsimIC::SetVNEDAirmassFpsIC(SCALAR north, SCALAR east, SCALAR down ) { + vnorthwind=north; veastwind=east; vdownwind=down; vw=sqrt(vnorthwind*vnorthwind + veastwind*veastwind + vdownwind*vdownwind); vtg=vt+vw; - hdot=-vtg*sin(gamma); + SetClimbRateFpsIC(-1*(vdown+vdownwind)); } void LaRCsimIC::SetAltitudeFtIC( SCALAR tt) { @@ -243,25 +230,15 @@ void LaRCsimIC::calcNEDfromVt(void) { vdownwind; } -void LaRCsimIC::SetVnorthFpsIC( SCALAR tt) { - vnorth=tt; +void LaRCsimIC::SetVNEDFpsIC( SCALAR north, SCALAR east, SCALAR down) { + vnorth=north; + veast=east; + vdown=down; + SetClimbRateFpsIC(-1*vdown); lastSpeedSet=lssetned; calcVtfromNED(); } -void LaRCsimIC::SetVeastFpsIC( SCALAR tt) { - veast=tt; - lastSpeedSet=lssetned; - calcVtfromNED(); -} - -void LaRCsimIC::SetVdownFpsIC( SCALAR tt) { - vdown=tt; - calcVtfromNED(); - SetClimbRateFpsIC(-1*vdown); - lastSpeedSet=lssetned; -} - void LaRCsimIC::SetLatitudeGDRadIC(SCALAR tt) { latitude_gd=tt; ls_geod_to_geoc(latitude_gd,altitude,&sea_level_radius, &latitude_gc);