setMaxLong(scFileNode->getDoubleValue("max-long", 0));
setMinLong(scFileNode->getDoubleValue("min-long", 0));
setMPControl(scFileNode->getBoolValue("mp-control", false));
+ setAIControl(scFileNode->getBoolValue("ai-control", false));
+ setCallSign(scFileNode->getStringValue("callsign", ""));
+
SGPropertyNode* flols = scFileNode->getChild("flols-pos");
if (flols) {
MPControl = c;
}
+void FGAICarrier::setAIControl(bool c) {
+ AIControl = c;
+}
+
void FGAICarrier::update(double dt) {
// Now update the position and heading. This will compute new hdg and
// roll values required for the rotation speed computation.
TurnToLaunch();
} else if(turn_to_recovery_hdg ){
TurnToRecover();
- } else if(OutsideBox() || returning ) {// check that the carrier is inside
- ReturnToBox(); // the operating box,
+ } else if(OutsideBox() || returning ) {// check that the carrier is inside
+ ReturnToBox(); // the operating box,
} else {
TurnToBase();
}
eyeWrtCarrier = ec2body.transform(eyeWrtCarrier);
// the eyepoints vector wrt the flols position
SGVec3d eyeWrtFlols = eyeWrtCarrier - flols_off;
-
+
// the distance from the eyepoint to the flols
dist = norm(eyeWrtFlols);
-
+
// now the angle, positive angles are upwards
if (fabs(dist) < SGLimits<float>::min()) {
angle = 0;
sAngle = SGMiscd::min(1, SGMiscd::max(-1, sAngle));
angle = SGMiscd::rad2deg(asin(sAngle));
}
-
+
// set the value of source
if ( angle <= 4.35 && angle > 4.01 )
source = 1;
if (wind_speed_kts < 3){
tgt_heading = base_course + 60;
} else if (rel_wind < -9 && rel_wind >= -180){
- tgt_heading = wind_from_deg;
+ tgt_heading = wind_from_deg;
} else if (rel_wind > -7 && rel_wind < 45){
tgt_heading = wind_from_deg + 60;
} else if (rel_wind >=45 && rel_wind < 180){
tgt_heading = wind_from_deg + 45;
- } else
+ } else
tgt_heading = hdg;
SG_NORMALIZE_RANGE(tgt_heading, 0.0, 360.0);