From 7f5a0e35184677c21f1eafdfbe6438eb644cdbff Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Fri, 15 Apr 2011 00:15:18 +0200 Subject: [PATCH 01/12] Adrian Musceac: #303, YASim solver settings The internal solver of YASim which computes drag and lift coefficients now actually uses the values configured in the XML input file for approach fuel, cruise fuel and cruise glide angle. --- src/FDM/YASim/Airplane.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FDM/YASim/Airplane.cpp b/src/FDM/YASim/Airplane.cpp index 483da4269..f63eaaa5e 100644 --- a/src/FDM/YASim/Airplane.cpp +++ b/src/FDM/YASim/Airplane.cpp @@ -671,8 +671,8 @@ void Airplane::compile() t->handle = body->addMass(0, t->pos); totalFuel += t->cap; } - _cruiseWeight = _emptyWeight + totalFuel*0.5f; - _approachWeight = _emptyWeight + totalFuel*0.2f; + _cruiseWeight = _emptyWeight + totalFuel*_cruiseFuel; + _approachWeight = _emptyWeight + totalFuel*_approachFuel; body->recalc(); @@ -795,7 +795,7 @@ void Airplane::setupWeights(bool isApproach) void Airplane::runCruise() { - setupState(_cruiseAoA, _cruiseSpeed,_approachGlideAngle, &_cruiseState); + setupState(_cruiseAoA, _cruiseSpeed,_cruiseGlideAngle, &_cruiseState); _model.setState(&_cruiseState); _model.setAir(_cruiseP, _cruiseT, Atmosphere::calcStdDensity(_cruiseP, _cruiseT)); From dc76290d6e7d2f24d6c352d8f9da4b0f9f1e5f40 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Fri, 15 Apr 2011 00:20:06 +0200 Subject: [PATCH 02/12] Minor file mode issue. --- src/FDM/JSBSim/models/FGAuxiliary.cpp | 0 src/FDM/JSBSim/models/propulsion/FGTurboProp.cpp | 0 src/FDM/JSBSim/models/propulsion/FGTurboProp.h | 0 3 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/FDM/JSBSim/models/FGAuxiliary.cpp mode change 100755 => 100644 src/FDM/JSBSim/models/propulsion/FGTurboProp.cpp mode change 100755 => 100644 src/FDM/JSBSim/models/propulsion/FGTurboProp.h diff --git a/src/FDM/JSBSim/models/FGAuxiliary.cpp b/src/FDM/JSBSim/models/FGAuxiliary.cpp old mode 100755 new mode 100644 diff --git a/src/FDM/JSBSim/models/propulsion/FGTurboProp.cpp b/src/FDM/JSBSim/models/propulsion/FGTurboProp.cpp old mode 100755 new mode 100644 diff --git a/src/FDM/JSBSim/models/propulsion/FGTurboProp.h b/src/FDM/JSBSim/models/propulsion/FGTurboProp.h old mode 100755 new mode 100644 From fb52b013f0e5e3371a1a82e0cbb51d3bbfd18e6d Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Fri, 15 Apr 2011 21:34:44 +0200 Subject: [PATCH 03/12] Clear OSG object cache on scenery reload Scenery reload (menu: Debug-> Reload Scenery) also needs to clear the OSG object cache, otherwise scenery isn't really reloaded from disk. --- src/Scenery/tilemgr.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index 6c19ec5c0..7b59d60b0 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -88,6 +88,8 @@ FGTileMgr::~FGTileMgr() { group->removeChildren(0, group->getNumChildren()); delete _propListener; _propListener = NULL; + // clear OSG cache + osgDB::Registry::instance()->clearObjectCache(); } @@ -122,6 +124,12 @@ void FGTileMgr::reinit() group->removeChildren(0, group->getNumChildren()); tile_cache.init(); + // clear OSG cache, except on initial start-up + if (state != Start) + { + osgDB::Registry::instance()->clearObjectCache(); + } + state = Inited; previous_bucket.make_bad(); From 0c500d4fc425d27c63d5505a770cdc19b2c46264 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sat, 16 Apr 2011 10:53:09 +0200 Subject: [PATCH 04/12] Wish #304: MapWidget's center-on-aircraft button should be sticky Thanks to Victhor Foster for the idea. --- src/GUI/MapWidget.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/GUI/MapWidget.cxx b/src/GUI/MapWidget.cxx index b482ada90..cd648fefb 100644 --- a/src/GUI/MapWidget.cxx +++ b/src/GUI/MapWidget.cxx @@ -527,7 +527,6 @@ void MapWidget::draw(int dx, int dy) if (_root->getBoolValue("centre-on-aircraft")) { _projectionCenter = _aircraft; - _root->setBoolValue("centre-on-aircraft", false); } double julianDate = globals->get_time_params()->getJD(); From b36b33f716031ef5933d41a1e5c17c6be3e54c28 Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Sat, 16 Apr 2011 11:35:56 +0200 Subject: [PATCH 05/12] Lauri Peltonen: make clearcolor black, so that space is dark instead of gray. --- src/Main/.renderer.cxx.swp | Bin 0 -> 49152 bytes src/Main/renderer.cxx | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 src/Main/.renderer.cxx.swp diff --git a/src/Main/.renderer.cxx.swp b/src/Main/.renderer.cxx.swp new file mode 100644 index 0000000000000000000000000000000000000000..9ebc72734e90afd3e326c450895b3ceb453748b4 GIT binary patch literal 49152 zcmeI537q6fRp%4s8ibMI@PJkS-6K6&HFb6O3=G*ljn#E^IdxH4)pIeV*_r>$%IUnw zqpFLZ85G$;U2#zmbOnZ0M|U`cRad!&b&*4m8@vDkVNm4Kbs5A}VZZN1#Q(~FRo4ut zxSz_IUv=jHALomR7x7-acyVUp^!%dtq_HCzK99^~UiKq*ElysO$vkc%lkq#Xv-0>t zpVeZ!*Xmp-R3>wqBskvfl*TL7N_V_cuT?jCRlnHLXN$#JbG+j>%YMi2jFrxvyKsX0 zA@(V-Pl3Hrpx>*EUiFB~(IbZ^Eq0eG2STV4ni}6xgT0 zJ_YtE@c#`3dhLg0zD{kv4Qzu4SUi}2MWlbG{rxchZGtb@-xu+38{9wyiSr#`4!q0$ zejwkU1}-6CdH*1A18CUa58-q0eG2STV4ni}6xgT0J_YtEa6c(fEbF#^=AohhVEGCvLGz~jO9fDb)9lX)SS1V02W2ag38gGYeBM`7?u z@Mqvp!5hHq!LNengC7Gea3i<@Oo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r7TBSzrXSN-E zX$`+#!SP8&&3S|vu+*k;&P58`3lbxFOZ^QSC+2u^kaY%YdJgPDkueS3YT|2GZGSqw zpdjw1qJHSa+>{y*>eB7Ejs3|tb!M7XcMi>>(Sn@zyh5@3O&PeGWP?gZnYW#5O-Z9$LE+j~ zytLW$0*7s>Q`ad1CSD|WO>hn;-Alav;`KnCG;_2Xos!`xl76&wlAgwHi)LivGJx+EXTY3F%kFEtT&Nuyn6t=`6k%fC!X3;D(6 zWqk7fTb7z52>xCREy~$%g)&>c?Ouz$vb=Ep9G&A^fZAq{&~$Abiqfx!5ueg~IlHdu Ho#X!jzAm5x literal 0 HcmV?d00001 diff --git a/src/Main/renderer.cxx b/src/Main/renderer.cxx index d1fa367cf..c88003f1e 100644 --- a/src/Main/renderer.cxx +++ b/src/Main/renderer.cxx @@ -613,11 +613,11 @@ FGRenderer::update( bool refresh_camera_settings ) { if ( fgGetBool("/sim/rendering/textures") ) { SGVec4f clearColor(l->adj_fog_color()); - camera->setClearColor(toOsg(clearColor)); + camera->setClearColor(osg::Vec4(0.0, 0.0, 0.0, 1.0)); } } else { SGVec4f clearColor(l->sky_color()); - camera->setClearColor(toOsg(clearColor)); + camera->setClearColor(osg::Vec4(0.0, 0.0, 0.0, 1.0)); } // update fog params if visibility has changed From 9c3571da5f30e01c189f504ac97dbc9ba7aef670 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sun, 17 Apr 2011 17:35:31 +0200 Subject: [PATCH 06/12] ADF2 support New "--adf2" option. Also introducing "--adf1" for consistency, while keeping legacy "--adf". --- src/Main/options.cxx | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Main/options.cxx b/src/Main/options.cxx index b4a3bc830..99ecbf43b 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -1150,12 +1150,22 @@ fgOptNAV2( const char * arg ) } static int -fgOptADF( const char * arg ) +fgOptADF1( const char * arg ) { double rot, freq; if (parse_colon(arg, &rot, &freq)) - fgSetDouble("/instrumentation/adf/rotation-deg", rot); - fgSetDouble("/instrumentation/adf/frequencies/selected-khz", freq); + fgSetDouble("/instrumentation/adf[0]/rotation-deg", rot); + fgSetDouble("/instrumentation/adf[0]/frequencies/selected-khz", freq); + return FG_OPTIONS_OK; +} + +static int +fgOptADF2( const char * arg ) +{ + double rot, freq; + if (parse_colon(arg, &rot, &freq)) + fgSetDouble("/instrumentation/adf[1]/rotation-deg", rot); + fgSetDouble("/instrumentation/adf[1]/frequencies/selected-khz", freq); return FG_OPTIONS_OK; } @@ -1493,7 +1503,9 @@ struct OptionDesc { {"com2", true, OPTION_DOUBLE, "/instrumentation/comm[1]/frequencies/selected-mhz", false, "", 0 }, {"nav1", true, OPTION_FUNC, "", false, "", fgOptNAV1 }, {"nav2", true, OPTION_FUNC, "", false, "", fgOptNAV2 }, - {"adf", true, OPTION_FUNC, "", false, "", fgOptADF }, + {"adf", /*legacy*/ true, OPTION_FUNC, "", false, "", fgOptADF1 }, + {"adf1", true, OPTION_FUNC, "", false, "", fgOptADF1 }, + {"adf2", true, OPTION_FUNC, "", false, "", fgOptADF2 }, {"dme", true, OPTION_FUNC, "", false, "", fgOptDME }, {"min-status", true, OPTION_STRING, "/sim/aircraft-min-status", false, "all", 0 }, {"livery", true, OPTION_FUNC, "", false, "", fgOptLivery }, From e42a8f597c84d65a66978af76cfbb3aae02abf63 Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Mon, 18 Apr 2011 22:54:33 +0200 Subject: [PATCH 07/12] Automatic tower positioning New "auto-position" switch to always use closest tower for tower-view. Exposes new "/sim/airport/closest-airport-id" property. Display closest airport on groundradar by default. --- src/Environment/environment_mgr.cxx | 115 ++++++++++++++++++---------- src/Environment/environment_mgr.hxx | 5 +- src/Instrumentation/groundradar.cxx | 2 +- src/Main/fg_init.cxx | 39 +++++++++- 4 files changed, 114 insertions(+), 47 deletions(-) diff --git a/src/Environment/environment_mgr.cxx b/src/Environment/environment_mgr.cxx index 3182f1159..40ca18f20 100644 --- a/src/Environment/environment_mgr.cxx +++ b/src/Environment/environment_mgr.cxx @@ -42,6 +42,7 @@ #include "precipitation_mgr.hxx" #include "ridge_lift.hxx" #include "terrainsampler.hxx" +#include "Airports/simple.hxx" class SGSky; extern SGSky *thesky; @@ -49,8 +50,11 @@ extern SGSky *thesky; FGEnvironmentMgr::FGEnvironmentMgr () : _environment(new FGEnvironment()), fgClouds(new FGClouds()), + _cloudLayersDirty(true), _altitudeNode(fgGetNode("/position/altitude-ft", true)), - _cloudLayersDirty(true) + _longitude_n(fgGetNode( "/position/longitude-deg", true )), + _latitude_n( fgGetNode( "/position/latitude-deg", true )), + _positionTimeToLive(0.0) { set_subsystem("controller", Environment::LayerInterpolateController::createInstance( fgGetNode("/environment/config", true ) )); set_subsystem("realwx", Environment::RealWxController::createInstance( fgGetNode("/environment/realwx", true ) ), 1.0 ); @@ -111,73 +115,73 @@ FGEnvironmentMgr::bind () _tiedProperties.setRoot( fgGetNode( "/environment", true ) ); _tiedProperties.Tie( "effective-visibility-m", thesky, - &SGSky::get_visibility ); + &SGSky::get_visibility ); _tiedProperties.Tie("rebuild-layers", fgClouds, - &FGClouds::get_update_event, - &FGClouds::set_update_event); + &FGClouds::get_update_event, + &FGClouds::set_update_event); _tiedProperties.Tie("turbulence/use-cloud-turbulence", &sgEnviro, - &SGEnviro::get_turbulence_enable_state, - &SGEnviro::set_turbulence_enable_state); + &SGEnviro::get_turbulence_enable_state, + &SGEnviro::set_turbulence_enable_state); for (int i = 0; i < MAX_CLOUD_LAYERS; i++) { - SGPropertyNode_ptr layerNode = fgGetNode("/environment/clouds",true)->getChild("layer", i, true ); + SGPropertyNode_ptr layerNode = fgGetNode("/environment/clouds",true)->getChild("layer", i, true ); - _tiedProperties.Tie( layerNode->getNode("span-m",true), this, i, - &FGEnvironmentMgr::get_cloud_layer_span_m, - &FGEnvironmentMgr::set_cloud_layer_span_m); + _tiedProperties.Tie( layerNode->getNode("span-m",true), this, i, + &FGEnvironmentMgr::get_cloud_layer_span_m, + &FGEnvironmentMgr::set_cloud_layer_span_m); - _tiedProperties.Tie( layerNode->getNode("elevation-ft",true), this, i, - &FGEnvironmentMgr::get_cloud_layer_elevation_ft, - &FGEnvironmentMgr::set_cloud_layer_elevation_ft); + _tiedProperties.Tie( layerNode->getNode("elevation-ft",true), this, i, + &FGEnvironmentMgr::get_cloud_layer_elevation_ft, + &FGEnvironmentMgr::set_cloud_layer_elevation_ft); - _tiedProperties.Tie( layerNode->getNode("thickness-ft",true), this, i, - &FGEnvironmentMgr::get_cloud_layer_thickness_ft, - &FGEnvironmentMgr::set_cloud_layer_thickness_ft); + _tiedProperties.Tie( layerNode->getNode("thickness-ft",true), this, i, + &FGEnvironmentMgr::get_cloud_layer_thickness_ft, + &FGEnvironmentMgr::set_cloud_layer_thickness_ft); - _tiedProperties.Tie( layerNode->getNode("transition-ft",true), this, i, - &FGEnvironmentMgr::get_cloud_layer_transition_ft, - &FGEnvironmentMgr::set_cloud_layer_transition_ft); + _tiedProperties.Tie( layerNode->getNode("transition-ft",true), this, i, + &FGEnvironmentMgr::get_cloud_layer_transition_ft, + &FGEnvironmentMgr::set_cloud_layer_transition_ft); - _tiedProperties.Tie( layerNode->getNode("coverage",true), this, i, - &FGEnvironmentMgr::get_cloud_layer_coverage, - &FGEnvironmentMgr::set_cloud_layer_coverage); + _tiedProperties.Tie( layerNode->getNode("coverage",true), this, i, + &FGEnvironmentMgr::get_cloud_layer_coverage, + &FGEnvironmentMgr::set_cloud_layer_coverage); - _tiedProperties.Tie( layerNode->getNode("coverage-type",true), this, i, - &FGEnvironmentMgr::get_cloud_layer_coverage_type, - &FGEnvironmentMgr::set_cloud_layer_coverage_type); + _tiedProperties.Tie( layerNode->getNode("coverage-type",true), this, i, + &FGEnvironmentMgr::get_cloud_layer_coverage_type, + &FGEnvironmentMgr::set_cloud_layer_coverage_type); - _tiedProperties.Tie( layerNode->getNode( "visibility-m",true), this, i, - &FGEnvironmentMgr::get_cloud_layer_visibility_m, - &FGEnvironmentMgr::set_cloud_layer_visibility_m); + _tiedProperties.Tie( layerNode->getNode( "visibility-m",true), this, i, + &FGEnvironmentMgr::get_cloud_layer_visibility_m, + &FGEnvironmentMgr::set_cloud_layer_visibility_m); - _tiedProperties.Tie( layerNode->getNode( "alpha",true), this, i, - &FGEnvironmentMgr::get_cloud_layer_maxalpha, - &FGEnvironmentMgr::set_cloud_layer_maxalpha); + _tiedProperties.Tie( layerNode->getNode( "alpha",true), this, i, + &FGEnvironmentMgr::get_cloud_layer_maxalpha, + &FGEnvironmentMgr::set_cloud_layer_maxalpha); } _tiedProperties.setRoot( fgGetNode("/sim/rendering", true ) ); _tiedProperties.Tie( "clouds3d-enable", fgClouds, - &FGClouds::get_3dClouds, - &FGClouds::set_3dClouds); + &FGClouds::get_3dClouds, + &FGClouds::set_3dClouds); _tiedProperties.Tie( "clouds3d-density", thesky, - &SGSky::get_3dCloudDensity, - &SGSky::set_3dCloudDensity); + &SGSky::get_3dCloudDensity, + &SGSky::set_3dCloudDensity); _tiedProperties.Tie("clouds3d-vis-range", thesky, - &SGSky::get_3dCloudVisRange, - &SGSky::set_3dCloudVisRange); + &SGSky::get_3dCloudVisRange, + &SGSky::set_3dCloudVisRange); _tiedProperties.Tie("precipitation-enable", &sgEnviro, - &SGEnviro::get_precipitation_enable_state, - &SGEnviro::set_precipitation_enable_state); + &SGEnviro::get_precipitation_enable_state, + &SGEnviro::set_precipitation_enable_state); _tiedProperties.Tie("lightning-enable", &sgEnviro, - &SGEnviro::get_lightning_enable_state, - &SGEnviro::set_lightning_enable_state); + &SGEnviro::get_lightning_enable_state, + &SGEnviro::set_lightning_enable_state); sgEnviro.config(fgGetNode("/sim/rendering/precipitation")); } @@ -198,11 +202,38 @@ FGEnvironmentMgr::update (double dt) _environment->set_elevation_ft( _altitudeNode->getDoubleValue() ); simgear::Particles::setWindFrom( _environment->get_wind_from_heading_deg(), - _environment->get_wind_speed_kt() ); + _environment->get_wind_speed_kt() ); if( _cloudLayersDirty ) { _cloudLayersDirty = false; fgClouds->set_update_event( fgClouds->get_update_event()+1 ); } + + _positionTimeToLive -= dt; + if( _positionTimeToLive <= 0.0 ) + { + // update closest airport information + _positionTimeToLive = 30.0; + + SG_LOG(SG_ALL, SG_INFO, "FGEnvironmentMgr::update: updating closest airport"); + + SGGeod pos = SGGeod::fromDeg(_longitude_n->getDoubleValue(), + _latitude_n->getDoubleValue()); + + FGAirport * nearestAirport = FGAirport::findClosest(pos, 100.0); + if( nearestAirport == NULL ) + { + SG_LOG(SG_ALL,SG_WARN,"FGEnvironmentMgr::update: No airport within 100NM range"); + } + else + { + const string currentId = fgGetString("/sim/airport/closest-airport-id", ""); + if (currentId != nearestAirport->ident()) + { + fgSetString("/sim/airport/closest-airport-id", + nearestAirport->ident().c_str()); + } + } + } } FGEnvironment diff --git a/src/Environment/environment_mgr.hxx b/src/Environment/environment_mgr.hxx index e6041f813..67d929ec8 100644 --- a/src/Environment/environment_mgr.hxx +++ b/src/Environment/environment_mgr.hxx @@ -94,8 +94,11 @@ private: FGEnvironment * _environment; // always the same, for now FGClouds *fgClouds; - SGPropertyNode_ptr _altitudeNode; bool _cloudLayersDirty; + SGPropertyNode_ptr _altitudeNode; + SGPropertyNode_ptr _longitude_n; + SGPropertyNode_ptr _latitude_n; + double _positionTimeToLive; simgear::TiedPropertyList _tiedProperties; }; diff --git a/src/Instrumentation/groundradar.cxx b/src/Instrumentation/groundradar.cxx index ffa2e1fc9..c604cc43c 100644 --- a/src/Instrumentation/groundradar.cxx +++ b/src/Instrumentation/groundradar.cxx @@ -47,7 +47,7 @@ #include "groundradar.hxx" static const char* airport_source_node_name = "airport-id-source"; -static const char* default_airport_node_name = "/sim/tower/airport-id"; +static const char* default_airport_node_name = "/sim/airport/closest-airport-id"; static const char* texture_node_name = "texture-name"; static const char* default_texture_name = "Aircraft/Instruments/Textures/od_groundradar.rgb"; static const char* range_source_node_name = "range-source"; diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 9eb8ae7a9..50329b39f 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -793,14 +793,44 @@ static bool fgSetTowerPosFromAirportID( const string& id) { struct FGTowerLocationListener : SGPropertyChangeListener { void valueChanged(SGPropertyNode* node) { - const string id(node->getStringValue()); + string id(node->getStringValue()); + if (fgGetBool("/sim/tower/auto-position",true)) + { + // enforce using closest airport when auto-positioning is enabled + const char* closest_airport = fgGetString("/sim/airport/closest-airport-id", ""); + if (closest_airport && (id != closest_airport)) + { + id = closest_airport; + node->setStringValue(id); + } + } fgSetTowerPosFromAirportID(id); } }; +struct FGClosestTowerLocationListener : SGPropertyChangeListener +{ + void valueChanged(SGPropertyNode* ) + { + // closest airport has changed + if (fgGetBool("/sim/tower/auto-position",true)) + { + // update tower position + const char* id = fgGetString("/sim/airport/closest-airport-id", ""); + if (id && *id!=0) + fgSetString("/sim/tower/airport-id", id); + } + } +}; + void fgInitTowerLocationListener() { fgGetNode("/sim/tower/airport-id", true) ->addChangeListener( new FGTowerLocationListener(), true ); + FGClosestTowerLocationListener* ntcl = new FGClosestTowerLocationListener(); + fgGetNode("/sim/airport/closest-airport-id", true) + ->addChangeListener(ntcl , true ); + fgGetNode("/sim/tower/auto-position", true) + ->addChangeListener(ntcl, true ); } static void fgApplyStartOffset(const SGGeod& aStartPos, double aHeading, double aTargetHeading = HUGE_VAL) @@ -1163,6 +1193,7 @@ bool fgInitPosition() { // An airport + parking position is requested if ( fgSetPosFromAirportIDandParkpos( apt, parkpos ) ) { // set tower position + fgSetString("/sim/airport/closest-airport-id", apt.c_str()); fgSetString("/sim/tower/airport-id", apt.c_str()); set_pos = true; } @@ -1173,7 +1204,8 @@ bool fgInitPosition() { if ( fgSetPosFromAirportIDandRwy( apt, rwy_no, rwy_req ) ) { // set tower position (a little off the heading for single // runway airports) - fgSetString("/sim/tower/airport-id", apt.c_str()); + fgSetString("/sim/airport/closest-airport-id", apt.c_str()); + fgSetString("/sim/tower/airport-id", apt.c_str()); set_pos = true; } } @@ -1183,7 +1215,8 @@ bool fgInitPosition() { if ( fgSetPosFromAirportIDandHdg( apt, hdg ) ) { // set tower position (a little off the heading for single // runway airports) - fgSetString("/sim/tower/airport-id", apt.c_str()); + fgSetString("/sim/airport/closest-airport-id", apt.c_str()); + fgSetString("/sim/tower/airport-id", apt.c_str()); set_pos = true; } } From aae1b5494fc19430da86a2385d297d9c84836a35 Mon Sep 17 00:00:00 2001 From: Frederic Bouvier Date: Tue, 19 Apr 2011 22:32:23 +0200 Subject: [PATCH 08/12] Remove vim swap file --- src/Main/.renderer.cxx.swp | Bin 49152 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/Main/.renderer.cxx.swp diff --git a/src/Main/.renderer.cxx.swp b/src/Main/.renderer.cxx.swp deleted file mode 100644 index 9ebc72734e90afd3e326c450895b3ceb453748b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 49152 zcmeI537q6fRp%4s8ibMI@PJkS-6K6&HFb6O3=G*ljn#E^IdxH4)pIeV*_r>$%IUnw zqpFLZ85G$;U2#zmbOnZ0M|U`cRad!&b&*4m8@vDkVNm4Kbs5A}VZZN1#Q(~FRo4ut zxSz_IUv=jHALomR7x7-acyVUp^!%dtq_HCzK99^~UiKq*ElysO$vkc%lkq#Xv-0>t zpVeZ!*Xmp-R3>wqBskvfl*TL7N_V_cuT?jCRlnHLXN$#JbG+j>%YMi2jFrxvyKsX0 zA@(V-Pl3Hrpx>*EUiFB~(IbZ^Eq0eG2STV4ni}6xgT0 zJ_YtE@c#`3dhLg0zD{kv4Qzu4SUi}2MWlbG{rxchZGtb@-xu+38{9wyiSr#`4!q0$ zejwkU1}-6CdH*1A18CUa58-q0eG2STV4ni}6xgT0J_YtEa6c(fEbF#^=AohhVEGCvLGz~jO9fDb)9lX)SS1V02W2ag38gGYeBM`7?u z@Mqvp!5hHq!LNengC7Gea3i<@Oo3r=3HV2p5uXO{0{;X2GI$=?24(QWU>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+*k;&P58`3lbxFOZ^QSC+2u^kaY%YdJgPDkueS3YT|2GZGSqw zpdjw1qJHSa+>{y*>eB7Ejs3|tb!M7XcMi>>(Sn@zyh5@3O&PeGWP?gZnYW#5O-Z9$LE+j~ zytLW$0*7s>Q`ad1CSD|WO>hn;-Alav;`KnCG;_2Xos!`xl76&wlAgwHi)LivGJx+EXTY3F%kFEtT&Nuyn6t=`6k%fC!X3;D(6 zWqk7fTb7z52>xCREy~$%g)&>c?Ouz$vb=Ep9G&A^fZAq{&~$Abiqfx!5ueg~IlHdu Ho#X!jzAm5x From 38af5a2a072f8cb218612df6347a22686a9cf022 Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Thu, 21 Apr 2011 20:43:05 +0100 Subject: [PATCH 09/12] Improved 3D cloud support --- src/Environment/environment_mgr.cxx | 31 +++---- src/Environment/fgclouds.cxx | 130 +++++++++++++++++++--------- src/Environment/fgclouds.hxx | 9 +- 3 files changed, 115 insertions(+), 55 deletions(-) diff --git a/src/Environment/environment_mgr.cxx b/src/Environment/environment_mgr.cxx index 4d05fab29..04208d304 100644 --- a/src/Environment/environment_mgr.cxx +++ b/src/Environment/environment_mgr.cxx @@ -97,6 +97,7 @@ FGEnvironmentMgr::init () { SG_LOG( SG_GENERAL, SG_INFO, "Initializing environment subsystem"); SGSubsystemGroup::init(); + fgClouds->Init(); } void @@ -111,7 +112,7 @@ FGEnvironmentMgr::bind () { SGSubsystemGroup::bind(); _environment->Tie( fgGetNode("/environment", true ) ); - + _tiedProperties.setRoot( fgGetNode( "/environment", true ) ); _tiedProperties.Tie( "effective-visibility-m", thesky, @@ -128,27 +129,27 @@ FGEnvironmentMgr::bind () for (int i = 0; i < MAX_CLOUD_LAYERS; i++) { SGPropertyNode_ptr layerNode = fgGetNode("/environment/clouds",true)->getChild("layer", i, true ); - _tiedProperties.Tie( layerNode->getNode("span-m",true), this, i, + _tiedProperties.Tie( layerNode->getNode("span-m",true), this, i, &FGEnvironmentMgr::get_cloud_layer_span_m, &FGEnvironmentMgr::set_cloud_layer_span_m); - _tiedProperties.Tie( layerNode->getNode("elevation-ft",true), this, i, + _tiedProperties.Tie( layerNode->getNode("elevation-ft",true), this, i, &FGEnvironmentMgr::get_cloud_layer_elevation_ft, &FGEnvironmentMgr::set_cloud_layer_elevation_ft); - _tiedProperties.Tie( layerNode->getNode("thickness-ft",true), this, i, + _tiedProperties.Tie( layerNode->getNode("thickness-ft",true), this, i, &FGEnvironmentMgr::get_cloud_layer_thickness_ft, &FGEnvironmentMgr::set_cloud_layer_thickness_ft); - _tiedProperties.Tie( layerNode->getNode("transition-ft",true), this, i, + _tiedProperties.Tie( layerNode->getNode("transition-ft",true), this, i, &FGEnvironmentMgr::get_cloud_layer_transition_ft, &FGEnvironmentMgr::set_cloud_layer_transition_ft); - _tiedProperties.Tie( layerNode->getNode("coverage",true), this, i, + _tiedProperties.Tie( layerNode->getNode("coverage",true), this, i, &FGEnvironmentMgr::get_cloud_layer_coverage, &FGEnvironmentMgr::set_cloud_layer_coverage); - _tiedProperties.Tie( layerNode->getNode("coverage-type",true), this, i, + _tiedProperties.Tie( layerNode->getNode("coverage-type",true), this, i, &FGEnvironmentMgr::get_cloud_layer_coverage_type, &FGEnvironmentMgr::set_cloud_layer_coverage_type); @@ -174,9 +175,9 @@ FGEnvironmentMgr::bind () _tiedProperties.Tie("clouds3d-vis-range", thesky, &SGSky::get_3dCloudVisRange, &SGSky::set_3dCloudVisRange); - + _tiedProperties.Tie("precipitation-enable", &sgEnviro, - &SGEnviro::get_precipitation_enable_state, + &SGEnviro::get_precipitation_enable_state, &SGEnviro::set_precipitation_enable_state); _tiedProperties.Tie("lightning-enable", &sgEnviro, @@ -198,7 +199,7 @@ void FGEnvironmentMgr::update (double dt) { SGSubsystemGroup::update(dt); - + _environment->set_elevation_ft( _altitudeNode->getDoubleValue() ); simgear::Particles::setWindFrom( _environment->get_wind_from_heading_deg(), @@ -322,25 +323,25 @@ FGEnvironmentMgr::get_cloud_layer_coverage_type (int index) const return thesky->get_cloud_layer(index)->getCoverage(); } -double +double FGEnvironmentMgr::get_cloud_layer_visibility_m (int index) const { return thesky->get_cloud_layer(index)->getVisibility_m(); } -void +void FGEnvironmentMgr::set_cloud_layer_visibility_m (int index, double visibility_m) { thesky->get_cloud_layer(index)->setVisibility_m(visibility_m); } -double +double FGEnvironmentMgr::get_cloud_layer_maxalpha (int index ) const { return thesky->get_cloud_layer(index)->getMaxAlpha(); } -void +void FGEnvironmentMgr::set_cloud_layer_maxalpha (int index, double maxalpha) { thesky->get_cloud_layer(index)->setMaxAlpha(maxalpha); @@ -349,7 +350,7 @@ FGEnvironmentMgr::set_cloud_layer_maxalpha (int index, double maxalpha) -void +void FGEnvironmentMgr::set_cloud_layer_coverage_type (int index, int type ) { if( type < 0 || type >= SGCloudLayer::SG_MAX_CLOUD_COVERAGES ) { diff --git a/src/Environment/fgclouds.cxx b/src/Environment/fgclouds.cxx index f5a531382..ccd21e0ce 100644 --- a/src/Environment/fgclouds.cxx +++ b/src/Environment/fgclouds.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -47,12 +48,13 @@ extern SGSky *thesky; FGClouds::FGClouds() : snd_lightning(0), - clouds_3d_enabled(false) + clouds_3d_enabled(false), + index(0) { update_event = 0; } -FGClouds::~FGClouds() +FGClouds::~FGClouds() { } @@ -65,7 +67,7 @@ void FGClouds::set_update_event(int count) { buildCloudLayers(); } -void FGClouds::init(void) { +void FGClouds::Init(void) { if( snd_lightning == NULL ) { snd_lightning = new SGSoundSample("Sounds/thunder.wav", SGPath()); snd_lightning->set_max_dist(7000.0f); @@ -75,6 +77,10 @@ void FGClouds::init(void) { sgr->add( snd_lightning, "thunder" ); sgEnviro.set_sampleGroup( sgr ); } + + globals->get_commands()->addCommand("add-cloud", do_add_3Dcloud); + globals->get_commands()->addCommand("del-cloud", do_delete_3Dcloud); + globals->get_commands()->addCommand("move-cloud", do_move_3Dcloud); } // Build an invidual cloud. Returns the extents of the cloud for coverage calculations @@ -101,7 +107,10 @@ double FGClouds::buildCloud(SGPropertyNode *cloud_def_root, SGPropertyNode *box_ double x = sg_random() * SGCloudField::fieldSize - (SGCloudField::fieldSize / 2.0); double y = sg_random() * SGCloudField::fieldSize - (SGCloudField::fieldSize / 2.0); double z = grid_z_rand * (sg_random() - 0.5); - + + float lon = fgGetNode("/position/longitude-deg", false)->getFloatValue(); + float lat = fgGetNode("/position/latitude-deg", false)->getFloatValue(); + SGVec3f pos(x,y,z); for(int i = 0; i < box_def->nChildren() ; i++) { @@ -111,7 +120,7 @@ double FGClouds::buildCloud(SGPropertyNode *cloud_def_root, SGPropertyNode *box_ string type = abox->getStringValue("type", "cu-small"); cld_def = cloud_def_root->getChild(type.c_str()); if ( !cld_def ) return 0.0; - + double w = abox->getDoubleValue("width", 1000.0); double h = abox->getDoubleValue("height", 1000.0); int hdist = abox->getIntValue("hdist", 1); @@ -147,38 +156,10 @@ double FGClouds::buildCloud(SGPropertyNode *cloud_def_root, SGPropertyNode *box_ z = h * z + pos[2]; // Up/Down. pos[2] is the cloudbase SGVec3f newpos = SGVec3f(x, y, z); + SGNewCloud cld = SGNewCloud(texture_root, cld_def); - double min_width = cld_def->getDoubleValue("min-cloud-width-m", 500.0); - double max_width = cld_def->getDoubleValue("max-cloud-width-m", 1000.0); - double min_height = cld_def->getDoubleValue("min-cloud-height-m", min_width); - double max_height = cld_def->getDoubleValue("max-cloud-height-m", max_width); - double min_sprite_width = cld_def->getDoubleValue("min-sprite-width-m", 200.0); - double max_sprite_width = cld_def->getDoubleValue("max-sprite-width-m", min_sprite_width); - double min_sprite_height = cld_def->getDoubleValue("min-sprite-height-m", min_sprite_width); - double max_sprite_height = cld_def->getDoubleValue("max-sprite-height-m", max_sprite_width); - int num_sprites = cld_def->getIntValue("num-sprites", 20); - int num_textures_x = cld_def->getIntValue("num-textures-x", 1); - int num_textures_y = cld_def->getIntValue("num-textures-y", 1); - double bottom_shade = cld_def->getDoubleValue("bottom-shade", 1.0); - string texture = cld_def->getStringValue("texture", "cu.png"); - - SGNewCloud cld = - SGNewCloud(type, - texture_root, - texture, - min_width, - max_width, - min_height, - max_height, - min_sprite_width, - max_sprite_width, - min_sprite_height, - max_sprite_height, - bottom_shade, - num_sprites, - num_textures_x, - num_textures_y); - layer->addCloud(newpos, cld.genCloud()); + //layer->addCloud(newpos, cld.genCloud()); + layer->addCloud(lon, lat, z, x, y, index++, cld.genCloud()); } } } @@ -266,7 +247,6 @@ void FGClouds::buildLayer(int iLayer, const string& name, double coverage) { break; } } - } // Now we've built any clouds, enable them and set the density (coverage) @@ -335,7 +315,7 @@ void FGClouds::buildCloudLayers(void) { layer_type = "sc"; } } - + cloud_root->setStringValue("layer-type",layer_type); buildLayer(iLayer, layer_type, coverage_norm); } @@ -349,8 +329,80 @@ void FGClouds::set_3dClouds(bool enable) } } -bool FGClouds::get_3dClouds() const +bool FGClouds::get_3dClouds() const { return clouds_3d_enabled; } +/** + * Adds a 3D cloud to a cloud layer. + * + * Property arguments + * layer - the layer index to add this cloud to. (Defaults to 0) + * index - the index for this cloud (to be used later) + * lon/lat/alt - the position for the cloud + * (Various) - cloud definition properties. See README.3DClouds + * + */ + static bool + do_add_3Dcloud (const SGPropertyNode *arg) + { + int l = arg->getIntValue("layer", 0); + int index = arg->getIntValue("index", 0); + + SGPath texture_root = globals->get_fg_root(); + texture_root.append("Textures"); + texture_root.append("Sky"); + + float lon = arg->getFloatValue("lon-deg", 0.0f); + float lat = arg->getFloatValue("lat-deg", 0.0f); + float alt = arg->getFloatValue("alt-ft", 0.0f); + + // Adding a 3D cloud immediately makes this layer 3D. + thesky->get_cloud_layer(l)->set_enable3dClouds(true); + SGCloudField *layer = thesky->get_cloud_layer(l)->get_layer3D(); + SGNewCloud cld = SGNewCloud(texture_root, arg); + return layer->addCloud(lon, lat, alt, index, cld.genCloud()); + } + + /** + * Removes a 3D cloud from a cloud layer + * + * Property arguments + * + * layer - the layer index to remove this cloud from. (defaults to 0) + * index - the cloud index + * + */ + static bool + do_delete_3Dcloud (const SGPropertyNode *arg) + { + int l = arg->getIntValue("layer", 0); + int i = arg->getIntValue("index", 0); + + SGCloudField *layer = thesky->get_cloud_layer(l)->get_layer3D(); + return layer->deleteCloud(i); + } + +/** + * Move a cloud within a 3D layer + * + * Property arguments + * layer - the layer index to add this cloud to. (Defaults to 0) + * index - the cloud index to move. + * lon/lat/alt - the position for the cloud + * + */ + static bool + do_move_3Dcloud (const SGPropertyNode *arg) + { + int l = arg->getIntValue("layer", 0); + int i = arg->getIntValue("index", 0); + + float lon = arg->getFloatValue("lon-deg", 0.0f); + float lat = arg->getFloatValue("lat-deg", 0.0f); + float alt = arg->getFloatValue("alt-ft", 0.0f); + + SGCloudField *layer = thesky->get_cloud_layer(l)->get_layer3D(); + return layer->repositionCloud(i, lon, lat, alt); + } diff --git a/src/Environment/fgclouds.hxx b/src/Environment/fgclouds.hxx index 34ac595e3..9d26419ff 100644 --- a/src/Environment/fgclouds.hxx +++ b/src/Environment/fgclouds.hxx @@ -47,17 +47,24 @@ private: int update_event; SGSoundSample *snd_lightning; bool clouds_3d_enabled; + int index; public: FGClouds(); ~FGClouds(); - void init(void); + void Init(void); int get_update_event(void) const; void set_update_event(int count); bool get_3dClouds() const; void set_3dClouds(bool enable); + }; +static bool do_delete_3Dcloud (const SGPropertyNode *arg); +static bool do_move_3Dcloud (const SGPropertyNode *arg); +static bool do_add_3Dcloud (const SGPropertyNode *arg); + #endif // _FGCLOUDS_HXX + From 202e9571540cb12b66e06a4c26fe89a7876bbf95 Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Fri, 22 Apr 2011 21:06:28 +0100 Subject: [PATCH 10/12] Further updates to 3D clouds --- src/Environment/fgclouds.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Environment/fgclouds.cxx b/src/Environment/fgclouds.cxx index ccd21e0ce..6bd1d5aa7 100644 --- a/src/Environment/fgclouds.cxx +++ b/src/Environment/fgclouds.cxx @@ -357,12 +357,18 @@ bool FGClouds::get_3dClouds() const float lon = arg->getFloatValue("lon-deg", 0.0f); float lat = arg->getFloatValue("lat-deg", 0.0f); float alt = arg->getFloatValue("alt-ft", 0.0f); + float x = arg->getFloatValue("x-offset-m", 0.0f); + float y = arg->getFloatValue("y-offset-m", 0.0f); + + + SGCloudField *layer = thesky->get_cloud_layer(l)->get_layer3D(); + SGNewCloud cld = SGNewCloud(texture_root, arg); + bool success = layer->addCloud(lon, lat, alt, x, y, index, cld.genCloud()); // Adding a 3D cloud immediately makes this layer 3D. thesky->get_cloud_layer(l)->set_enable3dClouds(true); - SGCloudField *layer = thesky->get_cloud_layer(l)->get_layer3D(); - SGNewCloud cld = SGNewCloud(texture_root, arg); - return layer->addCloud(lon, lat, alt, index, cld.genCloud()); + + return success; } /** From 3e1aba3b2ac391fdb1eb1b5c9abdf05d80dd737d Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Sat, 23 Apr 2011 10:17:31 +0200 Subject: [PATCH 11/12] Sync. with JSBSim CVS, now properly --- src/FDM/JSBSim/math/FGLocation.h | 6 +++--- src/FDM/JSBSim/models/FGInput.cpp | 4 ++-- src/FDM/JSBSim/models/FGPropagate.cpp | 12 ++++++------ src/FDM/JSBSim/models/flight_control/FGGain.cpp | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) mode change 100644 => 100755 src/FDM/JSBSim/models/FGInput.cpp diff --git a/src/FDM/JSBSim/math/FGLocation.h b/src/FDM/JSBSim/math/FGLocation.h index 23b3845e6..c60e8ea2e 100644 --- a/src/FDM/JSBSim/math/FGLocation.h +++ b/src/FDM/JSBSim/math/FGLocation.h @@ -48,7 +48,7 @@ INCLUDES DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#define ID_LOCATION "$Id: FGLocation.h,v 1.25 2010/09/18 22:47:24 jberndt Exp $" +#define ID_LOCATION "$Id: FGLocation.h,v 1.27 2010/11/29 12:33:58 jberndt Exp $" /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FORWARD DECLARATIONS @@ -142,14 +142,14 @@ CLASS DOCUMENTATION @see W. C. Durham "Aircraft Dynamics & Control", section 2.2 @author Mathias Froehlich - @version $Id: FGLocation.h,v 1.25 2010/09/18 22:47:24 jberndt Exp $ + @version $Id: FGLocation.h,v 1.27 2010/11/29 12:33:58 jberndt Exp $ */ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS DECLARATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -class FGLocation : virtual FGJSBBase +class FGLocation : public FGJSBBase { public: /** Default constructor. */ diff --git a/src/FDM/JSBSim/models/FGInput.cpp b/src/FDM/JSBSim/models/FGInput.cpp old mode 100644 new mode 100755 index 65ab24db2..51b4a3984 --- a/src/FDM/JSBSim/models/FGInput.cpp +++ b/src/FDM/JSBSim/models/FGInput.cpp @@ -53,7 +53,7 @@ using namespace std; namespace JSBSim { -static const char *IdSrc = "$Id: FGInput.cpp,v 1.19 2010/02/25 05:21:36 jberndt Exp $"; +static const char *IdSrc = "$Id: FGInput.cpp,v 1.20 2010/11/18 12:38:06 jberndt Exp $"; static const char *IdHdr = ID_INPUT; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -191,7 +191,7 @@ bool FGInput::Run(void) ostringstream info; info << "JSBSim version: " << JSBSim_version << endl; info << "Config File version: " << needed_cfg_version << endl; -// info << "Aircraft simulated: " << Aircraft->GetAircraftName() << endl; + info << "Aircraft simulated: " << FDMExec->GetAircraft()->GetAircraftName() << endl; info << "Simulation time: " << setw(8) << setprecision(3) << FDMExec->GetSimTime() << endl; socket->Reply(info.str()); diff --git a/src/FDM/JSBSim/models/FGPropagate.cpp b/src/FDM/JSBSim/models/FGPropagate.cpp index ae2174df9..6202ccc1c 100644 --- a/src/FDM/JSBSim/models/FGPropagate.cpp +++ b/src/FDM/JSBSim/models/FGPropagate.cpp @@ -71,7 +71,7 @@ using namespace std; namespace JSBSim { -static const char *IdSrc = "$Id: FGPropagate.cpp,v 1.85 2011/04/03 19:24:58 jberndt Exp $"; +static const char *IdSrc = "$Id: FGPropagate.cpp,v 1.86 2011/04/17 11:27:14 bcoconni Exp $"; static const char *IdHdr = ID_PROPAGATE; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -193,7 +193,6 @@ void FGPropagate::SetInitialState(const FGInitialCondition *FGIC) RecomputeLocalTerrainRadius(); VehicleRadius = GetRadius(); - double radInv = 1.0/VehicleRadius; // Set the angular velocities of the body frame relative to the ECEF frame, // expressed in the body frame. @@ -273,9 +272,10 @@ bool FGPropagate::Run(void) // orientation quaternion and vLocation vector. UpdateBodyMatrices(); - CalculateUVW(); // Translational position derivative (velocities are integrated in the inertial frame) + // Translational position derivative (velocities are integrated in the inertial frame) + CalculateUVW(); - // Set auxililary state variables + // Set auxilliary state variables RecomputeLocalTerrainRadius(); VehicleRadius = GetRadius(); // Calculate current aircraft radius from center of planet @@ -628,9 +628,9 @@ void FGPropagate::UpdateBodyMatrices(void) { Ti2b = VState.qAttitudeECI.GetT(); // ECI to body frame transform Tb2i = Ti2b.Transposed(); // body to ECI frame transform - Tl2b = Ti2b*Tl2i; // local to body frame transform + Tl2b = Ti2b * Tl2i; // local to body frame transform Tb2l = Tl2b.Transposed(); // body to local frame transform - Tec2b = Tl2b * Tec2l; // ECEF to body frame transform + Tec2b = Ti2b * Tec2i; // ECEF to body frame transform Tb2ec = Tec2b.Transposed(); // body to ECEF frame tranform } diff --git a/src/FDM/JSBSim/models/flight_control/FGGain.cpp b/src/FDM/JSBSim/models/flight_control/FGGain.cpp index fac82ab61..fb864e06b 100644 --- a/src/FDM/JSBSim/models/flight_control/FGGain.cpp +++ b/src/FDM/JSBSim/models/flight_control/FGGain.cpp @@ -47,7 +47,7 @@ using namespace std; namespace JSBSim { -static const char *IdSrc = "$Id: FGGain.cpp,v 1.20 2009/10/24 22:59:30 jberndt Exp $"; +static const char *IdSrc = "$Id: FGGain.cpp,v 1.23 2011/04/18 08:51:12 andgi Exp $"; static const char *IdHdr = ID_GAIN; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -70,7 +70,7 @@ FGGain::FGGain(FGFCS* fcs, Element* element) : FGFCSComponent(fcs, element) if (Type == "PURE_GAIN") { if ( !element->FindElement("gain") ) { - cout << highint << " No GAIN specified (default: 1.0)" << normint << endl; + cerr << highint << " No GAIN specified (default: 1.0)" << normint << endl; } } From 65607d4a7b8576905bb08f68a506aa87db258368 Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Sun, 24 Apr 2011 20:48:18 +0100 Subject: [PATCH 12/12] Add x-offset-m and y-offset-m to move-cloud command. --- src/Environment/fgclouds.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Environment/fgclouds.cxx b/src/Environment/fgclouds.cxx index 6bd1d5aa7..c57c4ee1d 100644 --- a/src/Environment/fgclouds.cxx +++ b/src/Environment/fgclouds.cxx @@ -408,7 +408,9 @@ bool FGClouds::get_3dClouds() const float lon = arg->getFloatValue("lon-deg", 0.0f); float lat = arg->getFloatValue("lat-deg", 0.0f); float alt = arg->getFloatValue("alt-ft", 0.0f); + float x = arg->getFloatValue("x-offset-m", 0.0f); + float y = arg->getFloatValue("y-offset-m", 0.0f); SGCloudField *layer = thesky->get_cloud_layer(l)->get_layer3D(); - return layer->repositionCloud(i, lon, lat, alt); + return layer->repositionCloud(i, lon, lat, alt, x, y); }