// If on ground, calculate heading change directly
if (onGround()) {
double headingDiff = fabs(hdg-tgt_heading);
- double bank_sense = 0.0;
+// double bank_sense = 0.0;
/*
double diff = fabs(hdg - tgt_heading);
if (diff > 180)
if (sum > 360.0)
sum -= 360.0;
if (fabs(sum - tgt_heading) > 0.0001) {
- bank_sense = -1.0;
+// bank_sense = -1.0;
} else {
- bank_sense = 1.0;
+// bank_sense = 1.0;
}
//if (trafficRef)
// cerr << trafficRef->getCallSign() << " Heading "
if (invisible)
return;
- double hdg, pch, rll, agl = 0;
+ double hdg, pch, rll;//, agl = 0;
if (_pnode != 0) {
setParentPos();
hdg = _p_hdg_node->getDoubleValue();
pch = _p_pch_node->getDoubleValue();
rll = _p_rll_node->getDoubleValue();
- agl = _p_agl_node->getDoubleValue();
+// agl = _p_agl_node->getDoubleValue();
setOffsetPos(_parentpos, hdg, pch, rll);
setSpeed(_p_spd_node->getDoubleValue());
}else {
hdg = manager->get_user_heading();
pch = manager->get_user_pitch();
rll = manager->get_user_roll();
- agl = manager->get_user_agl();
+// agl = manager->get_user_agl();
setOffsetPos(userpos, hdg, pch, rll);
setSpeed(manager->get_user_speed());
}
int y = node->getIntValue("y", -1);
int real_w = node->getIntValue("w", -1);
int real_h = node->getIntValue("h", -1);
- int w = node->getIntValue("w-base", -1);
- int h = node->getIntValue("h-base", -1);
+// int w = node->getIntValue("w-base", -1);
+// int h = node->getIntValue("h-base", -1);
if (x == -1 || y == -1) {
SG_LOG( SG_COCKPIT, SG_ALERT,
return 0;
}
- float w_scale = 1.0;
- float h_scale = 1.0;
+// float w_scale = 1.0;
+// float h_scale = 1.0;
if (real_w != -1) {
- w_scale = float(real_w) / float(w);
- w = real_w;
+// w_scale = float(real_w) / float(w);
+// w = real_w;
}
if (real_h != -1) {
- h_scale = float(real_h) / float(h);
- h = real_h;
+// h_scale = float(real_h) / float(h);
+// h = real_h;
}
SG_LOG( SG_COCKPIT, SG_BULK, "Reading instrument " << name );
//****************************************************************
//velocity vector reticle - computations
float xvvr, /* yvvr, */ Vxx = 0.0, Vyy = 0.0, Vzz = 0.0;
- float Axx = 0.0, Ayy = 0.0, Azz = 0.0, total_vel = 0.0, pot_slope, t1;
+ float Axx = 0.0, Ayy = 0.0, Azz = 0.0, total_vel = 0.0, pot_slope; //, t1;
float up_vel, ground_vel, actslope = 0.0, psi = 0.0;
float vel_x = 0.0, vel_y = 0.0, drift;
float alpha;
if (_energy_marker) {
if (total_vel < 5.0) {
- t1 = 0;
+// t1 = 0;
t2 = 0;
} else {
- t1 = up_vel / total_vel;
+// t1 = up_vel / total_vel;
t2 = asin((Vxx * Axx + Vyy * Ayy + Vzz * Azz) / (9.81 * total_vel));
}
pot_slope = ((t2 / 3) * SGD_RADIANS_TO_DEGREES) * _compression + vel_y;
}
//Calculate the 2D points via gluProject
- int result = GL_TRUE;
+// int result = GL_TRUE;
for (int i = 0; i < 6; i++) {
- result = simgear::project(_points3d[i][0], _points3d[i][1], _points3d[i][2],
+ /*result = */simgear::project(_points3d[i][0], _points3d[i][1], _points3d[i][2],
_mm, _pm, _view,
&_points2d[i][0], &_points2d[i][1], &_points2d[i][2]);
}
void HUD::Tape::draw_vertical(float value)
{
- float vmin = 0.0, vmax = 0.0;
+ float vmin = 0.0;//, vmax = 0.0;
float marker_xs;
float marker_xe;
float marker_ye;
if (!_pointer) {
vmin = value - _half_width_units; // width units == needle travel
- vmax = value + _half_width_units; // or picture unit span.
+// vmax = value + _half_width_units; // or picture unit span.
text_y = _center_y;
} else if (_pointer_type == MOVING) {
vmin = _input.min();
- vmax = _input.max();
+// vmax = _input.max();
} else { // FIXED
vmin = value - _half_width_units; // width units == needle travel
- vmax = value + _half_width_units; // or picture unit span.
+// vmax = value + _half_width_units; // or picture unit span.
text_y = _center_y;
}
void HUD::Tape::draw_horizontal(float value)
{
- float vmin = 0.0, vmax = 0.0;
+ float vmin = 0.0;//, vmax = 0.0;
float marker_xs;
- float marker_xe;
+// float marker_xe;
float marker_ys;
float marker_ye;
- float text_y = 0.0;
+// float text_y = 0.0;
float top = _y + _h;
float right = _x + _w;
if (!_pointer) {
vmin = value - _half_width_units; // width units == needle travel
- vmax = value + _half_width_units; // or picture unit span.
- text_y = _center_y;
+// vmax = value + _half_width_units; // or picture unit span.
+// text_y = _center_y;
} else if (_pointer_type == MOVING) {
vmin = _input.min();
- vmax = _input.max();
+// vmax = _input.max();
} else { // FIXED
vmin = value - _half_width_units; // width units == needle travel
- vmax = value + _half_width_units; // or picture unit span.
- text_y = _center_y;
+// vmax = value + _half_width_units; // or picture unit span.
+// text_y = _center_y;
}
// left tick bar
marker_ys = _y; // Starting point for
marker_ye = top; // tick y location calcs
- marker_xe = right;
+// marker_xe = right;
marker_xs = _x + ((value - vmin) * factor());
if (option_top()) {
}
double sim_time = globals->get_sim_time_sec();
- static double lastTime = 0.0;
+// static double lastTime = 0.0;
// SG_LOG(SG_GENERAL, SG_INFO, "actual dt=" << sim_time - lastTime);
- lastTime = sim_time;
+// lastTime = sim_time;
FlightProperties ifce;