X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2FAIBallistic.cxx;h=5e3b155095f1dc3147a81dbdbd2d80c7570387c3;hb=b78bf2e9e66f9e404f76d416db11315302da0f40;hp=000ce326611a51de8f513c79c4024fcaecfa246b;hpb=79e251383be10eee7314dc030bc5eaa4c034ce7b;p=flightgear.git diff --git a/src/AIModel/AIBallistic.cxx b/src/AIModel/AIBallistic.cxx index 000ce3266..5e3b15509 100644 --- a/src/AIModel/AIBallistic.cxx +++ b/src/AIModel/AIBallistic.cxx @@ -23,9 +23,9 @@ # include #endif -#include #include #include +#include #include @@ -33,33 +33,38 @@ #include
+using namespace simgear; + const double FGAIBallistic::slugs_to_kgs = 14.5939029372; const double FGAIBallistic::slugs_to_lbs = 32.1740485564; FGAIBallistic::FGAIBallistic(object_type ot) : -FGAIBase(ot), - _elevation(0), + FGAIBase(ot), + _height(0.0), + _ht_agl_ft(0.0), + _azimuth(0.0), + _elevation(0.0), + _rotation(0.0), + _formate_to_ac(false), _aero_stabilised(false), _drag_area(0.007), _life_timer(0.0), -_gravity(32.1740485564), + _gravity(32.1740485564), _buoyancy(0), + _wind(true), + _mass(0), _random(false), - _ht_agl_ft(0), _load_resistance(0), _solid(false), + _force_stabilised(false), + _slave_to_ac(false), + _slave_load_to_ac(false), + _contents_lb(0), _report_collision(false), _report_impact(false), -_wind(true), + _external_force(false), _impact_report_node(fgGetNode("/ai/models/model-impact", true)), -_external_force(false), -_slave_to_ac(false), -_slave_load_to_ac(false), -_formate_to_ac(false), -_contents_lb(0), -_mass(0), -_height(0), -_old_height(0) + _old_height(0) { no_roll = false; @@ -88,7 +93,7 @@ void FGAIBallistic::readFromScenario(SGPropertyNode* scFileNode) { setCd(scFileNode->getDoubleValue("cd", 0.029)); //setMass(scFileNode->getDoubleValue("mass", 0.007)); setWeight(scFileNode->getDoubleValue("weight", 0.25)); - setStabilisation(scFileNode->getBoolValue("aero_stabilized", false)); + setStabilisation(scFileNode->getBoolValue("aero-stabilized", false)); setNoRoll(scFileNode->getBoolValue("no-roll", false)); setRandom(scFileNode->getBoolValue("random", false)); setImpact(scFileNode->getBoolValue("impact", false)); @@ -99,7 +104,7 @@ void FGAIBallistic::readFromScenario(SGPropertyNode* scFileNode) { setSubID(scFileNode->getIntValue("SubID", 0)); setExternalForce(scFileNode->getBoolValue("external-force", false)); setForcePath(scFileNode->getStringValue("force-path", "")); - setForceStabilisation(scFileNode->getBoolValue("force_stabilized", false)); + setForceStabilisation(scFileNode->getBoolValue("force-stabilized", false)); setXoffset(scFileNode->getDoubleValue("x-offset", 0.0)); setYoffset(scFileNode->getDoubleValue("y-offset", 0.0)); setZoffset(scFileNode->getDoubleValue("z-offset", 0.0)); @@ -423,8 +428,8 @@ void FGAIBallistic::setForcePath(const string& p) { bool FGAIBallistic::getHtAGL(){ - if (globals->get_scenery()->get_elevation_m(pos.getLatitudeDeg(), pos.getLongitudeDeg(), - 10000.0, _elevation_m, &_material)){ + if (getGroundElevationM(SGGeod::fromGeodM(pos, 10000), + _elevation_m, &_material)) { _ht_agl_ft = pos.getElevationFt() - _elevation_m * SG_METER_TO_FEET; if (_material) { const vector& names = _material->get_names(); @@ -596,7 +601,7 @@ void FGAIBallistic::Run(double dt) { //calculate velocity due to external force double force_speed_north_deg_sec = 0; double force_speed_east_deg_sec = 0; - double vs_force_fps = 0; +// double vs_force_fps = 0; double hs_force_fps = 0; double v_force_acc_fpss = 0; double force_speed_north_fps = 0;