bool FGAIBallistic::init() {
FGAIBase::init();
- aero_stabilized = true;
hdg = azimuth;
pitch = elevation;
roll = rotation;
rotation = rl;
}
-void FGAIBallistic::setStabilization(bool val) {
- aero_stabilized = val;
+void FGAIBallistic::setStabilisation(bool val) {
+ aero_stabilised = val;
}
void FGAIBallistic::setDragArea(double a) {
pos.setelev(altitude * SG_FEET_TO_METER);
// recalculate pitch (velocity vector) if aerostabilized
- if (aero_stabilized) pitch = atan2( vs, hs ) * SG_RADIANS_TO_DEGREES;
+ // cout << "aero_stabilised " << aero_stabilised << endl ;
+ if (aero_stabilised) pitch = atan2( vs, hs ) * SG_RADIANS_TO_DEGREES;
// recalculate total speed
speed = sqrt( vs * vs + hs * hs);
void setAzimuth( double az );
void setElevation( double el );
void setRoll( double rl );
- void setStabilization( bool val );
+ void setStabilisation( bool val );
void setDragArea( double a );
void setLife( double seconds );
void setBuoyancy( double fpss );
double elevation; // degrees
double rotation; // degrees
double hs; // horizontal speed (fps)
- bool aero_stabilized; // if true, object will point where it's going
+ bool aero_stabilised; // if true, object will align wit trajectory
double drag_area; // equivalent drag area in ft2
double life_timer; // seconds
double gravity; // fps2
double cd; // coefficient of drag
bool wind; // if true, model reacts to parent wind
double mass; // in slugs
+ bool aero_stabilised; // if true, ballistic object aligns with trajectory
} FGAIModelEntity;
ai_ballistic->setRoll(entity->roll);
ai_ballistic->setCd(entity->cd);
ai_ballistic->setMass(entity->mass);
+ ai_ballistic->setStabilisation(entity->aero_stabilised);
ai_ballistic->init();
ai_ballistic->bind();
return ai_ballistic;
entity.wind = sm->wind;
entity.cd = sm->cd;
entity.mass = IC.mass;
+ entity.aero_stabilised = sm->aero_stabilised;
ai->createBallistic( &entity );
if (sm->count > 0) (sm->count)--;
sm->first_time = false;
sm->cd = entry_node->getDoubleValue("cd", 0.193);
sm->weight = entry_node->getDoubleValue("weight", 0.25);
+ sm->aero_stabilised = entry_node->getBoolValue ("aero-stabilised", true);
sm->contents_node = fgGetNode(entry_node->getStringValue("contents", "none"), true);
sm->trigger->setBoolValue(false);
double cd;
double weight;
double contents;
+ bool aero_stabilised;
} submodel;
typedef struct {