X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2FJSBSim.cxx;h=e8a96c0185854c8b858813a4bdce6ce424226d3d;hb=674a295896a1e56d605f39874262d6f146a586a3;hp=612424629aa053d9098a421695ed052c88925563;hpb=f2a817d1370cde5a94474344a65bacb2f7845352;p=flightgear.git diff --git a/src/FDM/JSBSim/JSBSim.cxx b/src/FDM/JSBSim/JSBSim.cxx index 612424629..e8a96c018 100644 --- a/src/FDM/JSBSim/JSBSim.cxx +++ b/src/FDM/JSBSim/JSBSim.cxx @@ -18,7 +18,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // -// $Id: JSBSim.cxx,v 1.63 2010/10/07 03:45:40 jberndt Exp $ +// $Id: JSBSim.cxx,v 1.64 2010/10/31 04:49:25 jberndt Exp $ #ifdef HAVE_CONFIG_H @@ -452,7 +452,7 @@ void FGJSBsim::update( double dt ) // ground in this area. double groundCacheRadius = acrad + 2*dt*Propagate->GetUVW().Magnitude(); double alt, slr, lat, lon; - FGColumnVector3 cart = Auxiliary->GetLocationVRP(); + FGLocation cart = Auxiliary->GetLocationVRP(); if ( needTrim && startup_trim->getBoolValue() ) { alt = fgic->GetAltitudeASLFtIC(); slr = fgic->GetSeaLevelRadiusFtIC(); @@ -488,9 +488,9 @@ void FGJSBsim::update( double dt ) if ( needTrim ) { if ( startup_trim->getBoolValue() ) { - double contact[3], d[3], agl; + double contact[3], d[3], vel[3], agl; get_agl_ft(fdmex->GetSimTime(), cart_pos, SG_METER_TO_FEET*2, contact, - d, d, d, &agl); + d, vel, d, &agl); double terrain_alt = sqrt(contact[0]*contact[0] + contact[1]*contact[1] + contact[2]*contact[2]) - fgic->GetSeaLevelRadiusFtIC(); @@ -498,6 +498,13 @@ void FGJSBsim::update( double dt ) "Ready to trim, terrain elevation is: " << terrain_alt * SG_METER_TO_FEET ); + if (fgGetBool("/sim/presets/onground")) { + FGColumnVector3 gndVelNED = cart.GetTec2l() + * FGColumnVector3(vel[0], vel[1], vel[2]); + fgic->SetVNorthFpsIC(gndVelNED(1)); + fgic->SetVEastFpsIC(gndVelNED(2)); + fgic->SetVDownFpsIC(gndVelNED(3)); + } fgic->SetTerrainElevationFtIC( terrain_alt ); do_trim(); } else {