void FGAIBase::Transform() {
if (!invisible) {
+ aip.setVisible(true);
aip.setPosition(pos);
if (no_roll)
aip.setOrientation(roll, pitch, hdg);
aip.update();
+ } else {
+ aip.setVisible(false);
+ aip.update();
}
}
SGRawValueMethods<FGAIBase,double>(*this,
&FGAIBase::_getCartPosZ,
0));
+ props->tie("callsign",
+ SGRawValueMethods<FGAIBase,const char*>(*this,
+ &FGAIBase::_getCallsign,
+ 0));
props->tie("orientation/pitch-deg", SGRawValuePointer<double>(&pitch));
props->tie("orientation/roll-deg", SGRawValuePointer<double>(&roll));
props->untie("position/global-x");
props->untie("position/global-y");
props->untie("position/global-z");
+ props->untie("callsign");
props->untie("orientation/pitch-deg");
props->untie("orientation/roll-deg");
}
SGVec3d FGAIBase::getCartPos() const {
- // Transform that one to the horizontal local coordinate system.
- SGQuatd hlTrans = SGQuatd::fromLonLat(pos);
-
- // and postrotate the orientation of the AIModel wrt the horizontal
- // local frame
- hlTrans *= SGQuatd::fromYawPitchRollDeg(hdg, pitch, roll);
-
SGVec3d cartPos = SGVec3d::fromGeod(pos);
-
return cartPos;
}
pos.setLatitudeDeg(latitude);
}
+void FGAIBase::_setUserPos(){
+ userpos.setLatitudeDeg(manager->get_user_latitude());
+ userpos.setLongitudeDeg(manager->get_user_longitude());
+ userpos.setElevationM(manager->get_user_altitude() * SG_FEET_TO_METER);
+}
+
void FGAIBase::_setSubID( int s ) {
_subID = s;
}
return hdg;
}
-const char* FGAIBase::_getPath() {
+double FGAIBase::_getXOffset() const {
+ return _x_offset;
+}
+
+double FGAIBase::_getYOffset() const {
+ return _y_offset;
+}
+
+double FGAIBase::_getZOffset() const {
+ return _z_offset;
+}
+
+const char* FGAIBase::_getPath() const {
+ return model_path.c_str();
+}
+
+const char* FGAIBase::_getSMPath() const {
return _path.c_str();
}
-const char* FGAIBase::_getName() {
+const char* FGAIBase::_getName() const {
return _name.c_str();
}
-const char* FGAIBase::_getCallsign() {
+const char* FGAIBase::_getCallsign() const {
return _callsign.c_str();
}
-const char* FGAIBase::_getSubmodel() {
+const char* FGAIBase::_getSubmodel() const {
return _submodel.c_str();
}
-
void FGAIBase::CalculateMach() {
// Calculate rho at altitude, using standard atmosphere
// For the temperature T and the pressure p,
// where:
// a = speed of sound [ft/s]
// g = specific heat ratio, which is usually equal to 1.4
- // R = specific gas constant, which equals 1716 ft-lb/slug/°R
+ // R = specific gas constant, which equals 1716 ft-lb/slug/R
a = sqrt ( 1.4 * 1716 * (T + 459.7));
// calculate Mach number