]> git.mxchange.org Git - flightgear.git/commitdiff
remove material name from the class
authormfranz <mfranz>
Sat, 14 Jul 2007 07:35:12 +0000 (07:35 +0000)
committermfranz <mfranz>
Sat, 14 Jul 2007 07:35:12 +0000 (07:35 +0000)
src/AIModel/AIBallistic.cxx
src/AIModel/AIBallistic.hxx

index 723da1373d26ecdd86d4687de25821532fb72bfc..c42d0d775c3d936890efb7e3d71b7d2591c91b75 100644 (file)
@@ -36,6 +36,7 @@ const double FGAIBallistic::slugs_to_kgs = 14.5939029372;
 
 FGAIBallistic::FGAIBallistic() :
     FGAIBase(otBallistic),
+    _elevation(0),
     _aero_stabilised(false),
     _drag_area(0.007),
     _life_timer(0.0),
@@ -47,9 +48,7 @@ FGAIBallistic::FGAIBallistic() :
     _solid(false),
     _report_collision(false),
     _report_impact(false),
-    _impact_report_node(fgGetNode("/ai/models/model-impact", true)),
-    _mat_name(""),
-    _elevation(0)
+    _impact_report_node(fgGetNode("/ai/models/model-impact", true))
 {
     no_roll = false;
 }
@@ -88,7 +87,7 @@ void FGAIBallistic::readFromScenario(SGPropertyNode* scFileNode) {
 bool FGAIBallistic::init(bool search_in_AI_path) {
     FGAIBase::init(search_in_AI_path);
 
-    props->setStringValue("material/name", _mat_name.c_str());
+    props->setStringValue("material/name", "");
     props->setStringValue("name", _name.c_str());
     props->setStringValue("submodels/path", _submodel.c_str());
 
@@ -335,14 +334,15 @@ void FGAIBallistic::handle_impact() {
 
     if (material) {
         const vector<string> names = material->get_names();
+        string mat_name;
 
         if (!names.empty())
-            _mat_name = names[0].c_str();
+            mat_name = names[0].c_str();
 
         _solid = material->get_solid();
         _load_resistance = material->get_load_resistance();
-        props->setStringValue("material/name", _mat_name.c_str());
-        //cout << "material " << _mat_name << " solid " << _solid << " load " << _load_resistance << endl;
+        props->setStringValue("material/name", mat_name.c_str());
+        //cout << "material " << mat_name << " solid " << _solid << " load " << _load_resistance << endl;
     }
 
     _ht_agl_ft = pos.getElevationFt() - elevation_m * SG_METER_TO_FEET;
index 58b6f40f0c03c777106a0845a5c9573bf2e4f034..ca92b8b8921b654b769836c7d5b63e0ce2513ad0 100644 (file)
@@ -105,7 +105,6 @@ private:
     double _dt_count;
     double _next_run;
 
-    string _mat_name;
     string _name;
     string _path;
     string _submodel;