//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/*****************************************************************
*
FGAIEntity::~FGAIEntity() {
//cout << "FGAIEntity dtor called..." << endl;
- ssgDeRefDelete(_model); // Ought to check valid?
//cout << "Removing model from scene graph..." << endl;
- globals->get_scenery()->get_scene_graph()->removeKid(_aip.getSceneGraph());
- // Unregister that one at the scenery manager
- globals->get_scenery()->unregister_placement_transform(_aip.getTransform());
+ globals->get_scenery()->get_scene_graph()->removeChild(_aip.getSceneGraph());
//cout << "Done!" << endl;
}
-void FGAIEntity::SetModel(ssgBranch* model) {
+void FGAIEntity::SetModel(osg::Node* model) {
_model = model;
- _model->ref();
- _aip.init(_model);
+ _aip.init(_model.get());
_aip.setVisible(false);
- globals->get_scenery()->get_scene_graph()->addKid(_aip.getSceneGraph());
- // Register that one at the scenery manager
- globals->get_scenery()->register_placement_transform(_aip.getTransform());
+ globals->get_scenery()->get_scene_graph()->addChild(_aip.getSceneGraph());
}
void FGAIEntity::Update(double dt) {
}
-string FGAIEntity::GetCallsign() {
- return("");
+const string &FGAIEntity::GetCallsign() {
+ static string s = "";
+ return(s);
}
void FGAIEntity::RegisterTransmission(int code) {