_elapsed_time += (sg_random() * 100);
+ _life_timer = 0;
+
props->setStringValue("material/name", "");
props->setStringValue("name", _name.c_str());
props->setStringValue("submodels/path", _path.c_str());
props->setStringValue("contents/path", _contents_path.c_str());
}
+ //cout << "init: name " << _name.c_str() << " _life_timer " << _life_timer
+ // << endl;
+
//if(_parent != ""){
// setParentNode();
//}
if (_random){
life = seconds * _randomness + (seconds * (1 -_randomness) * sg_random());
- //cout << "life " << life << endl;
+ //cout << " set life " << life << endl;
} else
life = seconds;
}
void FGAIBallistic::Run(double dt) {
_life_timer += dt;
+
+ //_pass += 1;
+ //cout<<"AIBallistic run: name " << _name.c_str()
+ // << " dt " << dt << " _life_timer " << _life_timer << " pass " << _pass << endl;
// if life = -1 the object does not die
if (_life_timer > life && life != -1){
if (_report_expiry && !_expiry_reported && !_impact_reported && !_collision_reported){
- //cout<<"AIBallistic: expiry"<< endl;
+ //cout<<"AIBallistic run: name " << _name.c_str() << " expiry " << " pass " << _pass <<endl;
handle_expiry();
- } else
+ } else{
+ //cout<<"AIBallistic run: name " << _name.c_str()
+ // << " die " << " _life_timer " << _life_timer << " pass " << _pass << endl;
setDie(true);
+ setTime(0);
+ }
}
n->setStringValue("type", "terrain");
SG_LOG(SG_GENERAL, SG_DEBUG, "AIBallistic: object impact " << _name
- << " lon " <<_impact_lon << " lat " <<_impact_lat);
+ << " lon " <<_impact_lon << " lat " <<_impact_lat << " sec " << _life_timer);
n->setDoubleValue("longitude-deg", _impact_lon);
n->setDoubleValue("latitude-deg", _impact_lat);