FGAIBase::FGAIBase()
: fp( NULL ),
- model( NULL ),
props( NULL ),
manager( NULL ),
_refID( _newAIModelID() )
{
_type_str = "model";
- tgt_heading = tgt_altitude = tgt_speed = 0.0;
+ tgt_heading = hdg = tgt_altitude = tgt_speed = 0.0;
tgt_roll = roll = tgt_pitch = tgt_yaw = tgt_vs = vs = pitch = 0.0;
bearing = elevation = range = rdot = 0.0;
x_shift = y_shift = rotation = 0.0;
root->removeChild(_type_str.c_str(), index);
delete fp;
fp = NULL;
- ssgDeRefDelete(model);
- model = 0;
}
void FGAIBase::update(double dt) {
// some more code here to check whether a model with this name has already been loaded
// if not load it, otherwise, get the memory pointer and do something like
// SetModel as in ATC/AIEntity.cxx
- //SSGBranch *model;
model = manager->getModel(path);
if (!(model))
{
sim_time_sec);
manager->setModel(path, model);
}
- //else
- // {
- // model->ref();
- // aip.init(model);
- // aip.setVisible(false);
- // globals->get_scenery()->get_scene_graph()->addKid(aip.getSceneGraph());
- // do some setModel stuff.
- if (model)
- model->ref();
-
return model;
}