X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FATCDCL%2FAIEntity.cxx;h=0d3d764fdafc967711cab234133f61783972b0e7;hb=0f9f0924121e680c68a1f6388d13a4c84ad1ded6;hp=f8284c3dbe2149ff331ef1bdde5b21643d07fe75;hpb=8ad7f4eb70d307bfb6f7b14a1a63ab2331d27183;p=flightgear.git diff --git a/src/ATCDCL/AIEntity.cxx b/src/ATCDCL/AIEntity.cxx index f8284c3db..0d3d764fd 100644 --- a/src/ATCDCL/AIEntity.cxx +++ b/src/ATCDCL/AIEntity.cxx @@ -39,31 +39,27 @@ #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(); }