_impact_reported = false;
_collision_reported = false;
_subID = 0;
+
+ _x_offset = 0;
+ _y_offset = 0;
+ _z_offset = 0;
+
+ _pitch_offset = 0;
+ _roll_offset = 0;
+ _yaw_offset = 0;
+
+ userpos = SGGeod::fromDeg(0, 0);
+
+ pos = SGGeod::fromDeg(0, 0);
+ speed = 0;
+ altitude_ft = 0;
+ speed_north_deg_sec = 0;
+ speed_east_deg_sec = 0;
+ turn_radius_ft = 0;
+
+ ft_per_deg_lon = 0;
+ ft_per_deg_lat = 0;
+
+ horiz_offset = 0;
+ vert_offset = 0;
+ ht_diff = 0;
+
+ serviceable = false;
+
+ fp = 0;
+
+ rho = 1;
+ T = 280;
+ p = 1e5;
+ a = 340;
+ Mach = 0;
}
FGAIBase::~FGAIBase() {
void FGAIBase::initModel(osg::Node *node)
{
if (model.valid()) {
- // Disable altitude computations for general AI models.
- model->setNodeMask(model->getNodeMask() & ~SG_NODEMASK_TERRAIN_BIT);
fgSetString("/ai/models/model-added", props->getPath());
props->untie("radar/ht-diff-ft");
props->untie("controls/lighting/nav-lights");
+
+ props->setBoolValue("/sim/controls/radar/", true);
+
}
double FGAIBase::UpdateRadar(FGAIManager* manager) {
+ bool control = fgGetBool("/sim/controls/radar", true);
+
+ if(!control) return 0;
+
double radar_range_ft2 = fgGetDouble("/instrumentation/radar/range");
bool force_on = fgGetBool("/instrumentation/radar/debug-mode", false);
radar_range_ft2 *= SG_NM_TO_METER * SG_METER_TO_FEET * 1.1; // + 10%
return cartPos;
}
+bool FGAIBase::getGroundElevationM(const SGGeod& pos, double& elev,
+ const SGMaterial** material) const {
+ return globals->get_scenery()->get_elevation_m(pos, elev, material,
+ model.get());
+}
+
double FGAIBase::_getCartPosX() const {
SGVec3d cartPos = getCartPos();
return cartPos.x();