X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2FAIBallistic.cxx;h=5e3b155095f1dc3147a81dbdbd2d80c7570387c3;hb=b78bf2e9e66f9e404f76d416db11315302da0f40;hp=8ad900bdb0f119dc6591b698d4773ed1c89a72f8;hpb=157eb857ef36636a316947fe1eb3d9a8bea1959b;p=flightgear.git diff --git a/src/AIModel/AIBallistic.cxx b/src/AIModel/AIBallistic.cxx index 8ad900bdb..5e3b15509 100644 --- a/src/AIModel/AIBallistic.cxx +++ b/src/AIModel/AIBallistic.cxx @@ -29,7 +29,6 @@ #include -#include "AIModelData.hxx" #include "AIBallistic.hxx" #include
@@ -40,30 +39,32 @@ 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)), - _force_stabilised(false), -_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; @@ -118,12 +119,6 @@ void FGAIBallistic::readFromScenario(SGPropertyNode* scFileNode) { setRandom(scFileNode->getBoolValue("random", false)); } -osg::Node* FGAIBallistic::load3DModel(const string &path, SGPropertyNode *prop_root) -{ - model = SGModelLib::loadModel(path, prop_root, new FGAIModelData(this, prop_root)); - return model.get(); -} - bool FGAIBallistic::init(bool search_in_AI_path) { FGAIBase::init(search_in_AI_path); @@ -433,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(); @@ -606,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;