else if (range_nm < 20.0)
range_nm = 20.0;
double rand = sg_random();
- SG_LOG( SG_INSTR, SG_DEBUG, " tacan range " << range_nm << " max range " << max_range_nm);
return range_nm + (range_nm * rand * rand);
}
_distance_node->setDoubleValue(0);
_speed_node->setDoubleValue(0);
_time_node->setDoubleValue(0);
- SG_LOG( SG_INSTR, SG_DEBUG, "skip tacan" );
return;
}
double mobile_bearing = 0;
double mobile_distance = 0;
- SG_LOG( SG_INSTR, SG_DEBUG, "mobile_name " << _mobile_name);
- SG_LOG( SG_INSTR, SG_DEBUG, "mobile_valid " << _mobile_valid);
geo_inverse_wgs_84(pos, _mobilePos,
&mobile_bearing, &mobile_az2, &mobile_distance);
//select the nearer
if ( mobile_distance <= distance && _mobile_valid) {
- SG_LOG( SG_INSTR, SG_DEBUG, "mobile_distance_m " << mobile_distance);
- SG_LOG( SG_INSTR, SG_DEBUG, "distance_m " << distance);
bearing = mobile_bearing;
distance = mobile_distance;
_transmitter_pos.setElevationFt(_mobilePos.getElevationFt());
double horiz_offset = bearing;
- SG_LOG( SG_INSTR, SG_DEBUG, "distance_nm " << distance_nm << " bearing "
- << bearing << " horiz_offset " << horiz_offset);
-
// calculate values for radar display
double y_shift = distance_nm * cos( horiz_offset * SG_DEGREES_TO_RADIANS);
double x_shift = distance_nm * sin( horiz_offset * SG_DEGREES_TO_RADIANS);
- SG_LOG( SG_INSTR, SG_DEBUG, "y_shift " << y_shift << " x_shift " << x_shift);
-
double rotation = 0;
double range_nm = adjust_range(_transmitter_pos.getElevationFt(),
int number, i;
_mobile_valid = false;
- SG_LOG( SG_INSTR, SG_DEBUG, "tacan freq " << frequency_mhz );
-
// reset search time
_time_before_search_sec = 1.0;
//try any carriers first
FGNavRecord *mobile_tacan = FGNavList::findByFreq( frequency_mhz, FGNavList::carrierFilter() );
bool freq_valid = (mobile_tacan != NULL);
- SG_LOG( SG_INSTR, SG_DEBUG, "mobile freqency valid " << freq_valid );
if ( freq_valid ) {
number = carrier.size();
- SG_LOG( SG_INSTR, SG_DEBUG, "carrier " << number );
for ( i = 0; i < number; ++i ) {
string str2 ( carrier[i]->getStringValue("name", ""));
- SG_LOG( SG_INSTR, SG_DEBUG, "carrier name " << str2 );
- SG_LOG( SG_INSTR, SG_DEBUG, "strings 1 " << str1 << " 2 " << str2 );
string::size_type loc1= str1.find( str2, 0 );
if ( loc1 != string::npos && str2 != "" ) {
- SG_LOG( SG_INSTR, SG_DEBUG, " string found" );
_mobilePos = SGGeod::fromDegFt(
carrier[i]->getDoubleValue("position/longitude-deg"),
carrier[i]->getDoubleValue("position/latitude-deg"),
_mobile_name = mobile_tacan->name();
_mobile_ident = mobile_tacan->get_trans_ident();
_mobile_valid = true;
- SG_LOG( SG_INSTR, SG_DEBUG, " carrier transmitter valid " << _mobile_valid );
break;
} else {
_mobile_valid = false;
- SG_LOG( SG_INSTR, SG_DEBUG, " carrier transmitter invalid " << _mobile_valid );
}
}
//try any AI tankers second
-
if ( !_mobile_valid) {
- SG_LOG( SG_INSTR, SG_DEBUG, "tanker transmitter valid start " << _mobile_valid );
-
SGPropertyNode * branch = fgGetNode("ai/models", true);
vector<SGPropertyNode_ptr> tanker = branch->getChildren("tanker");
number = tanker.size();
- SG_LOG( SG_INSTR, SG_DEBUG, "tanker number " << number );
-
for ( i = 0; i < number; ++i ) {
string str4 ( tanker[i]->getStringValue("callsign", ""));
- SG_LOG( SG_INSTR, SG_DEBUG, "tanker callsign " << str4 );
-
- SG_LOG( SG_INSTR, SG_DEBUG, "strings 1 " << str1 << " 4 " << str4 );
string::size_type loc1= str1.find( str4, 0 );
if ( loc1 != string::npos && str4 != "" ) {
- SG_LOG( SG_INSTR, SG_DEBUG, " string found" );
_mobilePos = SGGeod::fromDegFt(
tanker[i]->getDoubleValue("position/longitude-deg"),
tanker[i]->getDoubleValue("position/latitude-deg"),
_mobile_name = mobile_tacan->name();
_mobile_ident = mobile_tacan->get_trans_ident();
_mobile_valid = true;
- SG_LOG( SG_INSTR, SG_DEBUG, " tanker transmitter valid " << _mobile_valid );
break;
} else {
_mobile_valid = false;
- SG_LOG( SG_INSTR, SG_DEBUG, " tanker transmitter invalid " << _mobile_valid );
}
}
}
//try any mp tankers third, if we haven't found the tanker in the ai aircraft
if ( !_mobile_valid ) {
- SG_LOG( SG_INSTR, SG_DEBUG, " mp tanker transmitter valid start " << _mobile_valid );
-
SGPropertyNode * branch = fgGetNode("ai/models", true);
vector<SGPropertyNode_ptr> mp_tanker = branch->getChildren("multiplayer");
number = mp_tanker.size();
- SG_LOG( SG_INSTR, SG_DEBUG, " mp tanker number " << number );
-
if ( number > 0 ) { // don't do this if there are no MP aircraft
for ( i = 0; i < number; ++i ) {
string str6 ( mp_tanker[i]->getStringValue("callsign", ""));
- SG_LOG( SG_INSTR, SG_DEBUG, "mp tanker callsign " << str6 );
-
- SG_LOG( SG_INSTR, SG_DEBUG, "strings 1 " << str1 << " 5 " << str6 );
string::size_type loc1= str1.find( str6, 0 );
if ( loc1 != string::npos && str6 != "" ) {
- SG_LOG( SG_INSTR, SG_DEBUG, " string found" );
_mobilePos = SGGeod::fromDegFt(
mp_tanker[i]->getDoubleValue("position/longitude-deg"),
mp_tanker[i]->getDoubleValue("position/latitude-deg"),
_mobile_name = mobile_tacan->name();
_mobile_ident = mobile_tacan->get_trans_ident();
_mobile_valid = true;
-
- SG_LOG( SG_INSTR, SG_DEBUG, " mp tanker transmitter valid " << _mobile_valid );
- SG_LOG( SG_INSTR, SG_DEBUG, " mp tanker name " << _mobile_name);
- SG_LOG( SG_INSTR, SG_DEBUG, " mp range " << _mobile_range_nm);
break;
} else {
_mobile_valid = false;
- SG_LOG( SG_INSTR, SG_DEBUG, " mp tanker transmitter invalid " << _mobile_valid );
- }
+ }
}
}
}
} else {
_mobile_valid = false;
- SG_LOG( SG_INSTR, SG_DEBUG, " mobile transmitter invalid " << _mobile_valid );
}
// try the TACAN/VORTAC list next
_transmitter_valid = (tacan != NULL);
if ( _transmitter_valid ) {
- SG_LOG( SG_INSTR, SG_DEBUG, "transmitter valid " << _transmitter_valid );
_transmitter_pos = tacan->geod();
_transmitter_range_nm = tacan->get_range();
_name_node->setStringValue(_transmitter_name.c_str());
_transmitter_ident = tacan->get_trans_ident();
_ident_node->setStringValue(_transmitter_ident.c_str());
-
- SG_LOG( SG_INSTR, SG_DEBUG, "name " << _transmitter_name);
- SG_LOG( SG_INSTR, SG_DEBUG, _transmitter_pos);
-
- } else {
- SG_LOG( SG_INSTR, SG_DEBUG, "transmitter invalid " << _transmitter_valid );
}
}
const SGVec4f base_sky_color( 0.31, 0.43, 0.69, 1.0 );
const SGVec4f base_fog_color( 0.63, 0.72, 0.88, 1.0 );
- SG_LOG( SG_EVENT, SG_DEBUG, "Updating light parameters." );
-
// calculate lighting parameters based on sun's relative angle to
// local up
float av = _humidity->getFloatValue() * 45;
float visibility_inv = (45000.0 - av)/45000.0;
float deg = _sun_angle * SGD_RADIANS_TO_DEGREES;
- SG_LOG( SG_EVENT, SG_DEBUG, " Sun angle = " << deg );
if (_saturation < 0.0) _saturation = 0.0;
else if (_saturation > 1.0) _saturation = 1.0;
specular *= _saturation;
sky_brightness *= _saturation;
- SG_LOG( SG_EVENT, SG_DEBUG,
- " ambient = " << ambient << " diffuse = " << diffuse
- << " specular = " << specular << " sky = " << sky_brightness );
-
// sky_brightness = 0.15; // used to force a dark sky (when testing)
/** fog color */
void FGLight::updateSunPos()
{
SGTime *t = globals->get_time_params();
- SG_LOG( SG_EVENT, SG_DEBUG, " Updating Sun position" );
- SG_LOG( SG_EVENT, SG_DEBUG, " Gst = " << t->getGst() );
fgSunPositionGST(t->getGst(), &_sun_lon, &_sun_lat);
SGVec3d sunpos = SGVec3d::fromGeoc(SGGeoc::fromRadM(_sun_lon, _sun_lat,
SGGeodesy::EQURAD));
- SG_LOG( SG_EVENT, SG_DEBUG, " t->cur_time = " << t->get_cur_time() );
- SG_LOG( SG_EVENT, SG_DEBUG,
- " Sun Geocentric lat = " << _sun_lat
- << " Geodcentric lat = " << _sun_lat );
-
// update the sun light vector
_sun_vec = SGVec4f(toVec3f(normalize(sunpos)), 0);
_sun_vec_inv = - _sun_vec;
double signedPI = (_sun_angle < 0.0) ? -SGD_PI : SGD_PI;
_sun_angle = fmod(_sun_angle+signedPI, SGD_2PI) - signedPI;
- SG_LOG( SG_EVENT, SG_DEBUG, "sun angle relative to current location = "
- << get_sun_angle() );
-
// Get direction to the sun in the local frame.
SGVec3d local_sun_vec = hlOr.transform(nsun);