]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATCDCL/AIEntity.cxx
Merge branch 'torsten/proplist' into next
[flightgear.git] / src / ATCDCL / AIEntity.cxx
index f8284c3dbe2149ff331ef1bdde5b21643d07fe75..0d3d764fdafc967711cab234133f61783972b0e7 100644 (file)
 
 #include "AIEntity.hxx"
 
-FGAIEntity::FGAIEntity() {
+FGAIEntity::FGAIEntity() :
+    _ground_elevation_m(0)
+{
 }
 
 FGAIEntity::~FGAIEntity() {
-       //cout << "FGAIEntity dtor called..." << endl;
-       //cout << "Removing model from scene graph..." << endl;
-       globals->get_scenery()->get_scene_graph()->removeChild(_aip.getSceneGraph());
-
-       //cout << "Done!" << endl;
+    globals->get_scenery()->get_scene_graph()->removeChild(_aip.getSceneGraph());
 }
 
 void FGAIEntity::SetModel(osg::Node* model) {
-       _model = model;
-       _aip.init(_model.get());
-       _aip.setVisible(false);
-       globals->get_scenery()->get_scene_graph()->addChild(_aip.getSceneGraph());
-
+    _aip.init(model);
+    _aip.setVisible(false);
+    globals->get_scenery()->get_scene_graph()->addChild(_aip.getSceneGraph());
 }
 
 void FGAIEntity::Update(double dt) {
 }
 
 const string &FGAIEntity::GetCallsign() {
-       static string s = "";
-       return(s);
+    static string s = "";
+    return(s);
 }
 
 void FGAIEntity::RegisterTransmission(int code) {
@@ -72,7 +68,7 @@ void FGAIEntity::RegisterTransmission(int code) {
 // Run the internal calculations
 //void FGAIEntity::Update() {
 void FGAIEntity::Transform() {
-    _aip.setPosition(_pos.lon(), _pos.lat(), _pos.elev() * SG_METER_TO_FEET);
+    _aip.setPosition(_pos);
     _aip.setOrientation(_roll, _pitch, _hdg);
     _aip.update();    
 }