#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) {
// 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();
}