- update ls2-boxer-96srs.xml for correct rpm scale

- update sky code


git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6711 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: e047391f5675677ae8aa79038b79a9777e5b5962
Former-commit-id: 6b83ae175d3c38b1cce81573bcf43dcca3da91bf
This commit is contained in:
torcs-ng 2019-08-07 08:00:49 +00:00
parent 96661dd696
commit e87e734fca
4 changed files with 29 additions and 10 deletions

View file

@ -104,7 +104,7 @@ void cGrSky::build(double h_radius, double v_radius,
moon->setMoonDist( moon_dist );
sun = new cGrSun;
sun_transform -> addKid( sun->build( sun_size, humidity, airdensity));
sun_transform -> addKid( sun->build( sun_size, humidity, airdensity - 0.45));
sun->setSunDistance( sun_dist );
pre_transform -> addKid( stars_transform );

View file

@ -229,7 +229,7 @@ bool cGrSun::repaint( double sun_angle, double new_visibility )
prev_sun_angle = sun_angle;
float aerosol_factor;
if ( visibility < 100 )
if ( visibility < 360 )
{
aerosol_factor = 8000;
}

View file

@ -524,7 +524,7 @@ reTrackInitRealWeather(void)
snprintf(buffer, 255, "%sconfig/weather.txt", GetLocalDir());
std::string data = buffer;
GfLogInfo("Path weather.txt : %s\n", data.c_str());
GfLogDebug("Path weather.txt : %s\n", data.c_str());
std::ifstream file(data.c_str());
@ -554,7 +554,7 @@ reTrackInitRealWeather(void)
if (webMetar->getCAVOK())
{
if (webMetar->getVisibility_m() == WebMetarNaN)
if (webMetar->getVisibility_m() == WebMetarNaN || webMetar->getVisibility_m() < 0)
webMetarVisibility.set(12000.0);
if (webMetar->getCloudNumber() > 0)
@ -566,9 +566,13 @@ reTrackInitRealWeather(void)
}
// visibility
tdble _wind_range_from = 0.0;
tdble _wind_range_to = 0.0;
tdble _wind_range_from = 0.0;
tdble _wind_range_to = 0.0;
tdble d = (tdble)(webMetar->getVisibility_m());
if (d < 0.0)
d = 12000.0;
GfLogDebug("WebMetar Visibility in racetrack = %.3f\n", webMetar->getVisibility_m());
if (d == WebMetarNaN )
@ -653,7 +657,11 @@ reTrackInitRealWeather(void)
trackLocal->airpressure = (tdble)(webMetar->getPressure_hPa());
trackLocal->airpressure = (tdble)(trackLocal->airpressure * 100);
trackLocal->airdensity = (tdble)(webMetar->getDensity_C());
if (webMetar->getDensity_C() == WebMetarNaN)
trackLocal->airdensity = 1.219f;
else
trackLocal->airdensity = (tdble)(webMetar->getDensity_C());
if (ReInfo->s->_features & RM_FEATURE_WETTRACK)
{
@ -767,11 +775,14 @@ reTrackInitSimuWeather(void)
}
// visibility
tdble _wind_range_from = 0.0;
tdble _wind_range_to = 0.0;
tdble _wind_range_from = 0.0;
tdble _wind_range_to = 0.0;
tdble d = (tdble)(webMetar->getVisibility_m());
GfLogDebug("WebMetar Visibility in racetrack = %.3f\n", webMetar->getVisibility_m());
if (d < 0.0)
d = 12000.0;
if (d == WebMetarNaN )
d = 10000.0;
@ -853,6 +864,13 @@ reTrackInitSimuWeather(void)
else
trackLocal->airpressure = (tdble)(webMetar->getPressure_hPa());
trackLocal->airpressure = (tdble)(trackLocal->airpressure * 100);
if (webMetar->getDensity_C() == WebMetarNaN)
trackLocal->airdensity = 1.219f;
else
trackLocal->airdensity = (tdble)(webMetar->getDensity_C());
if (ReInfo->s->_features & RM_FEATURE_WETTRACK)
{
trackLocal->rain = webMetar->getRain();
@ -874,6 +892,7 @@ reTrackInitSimuWeather(void)
GfLogDebug("Air Temperature = %.3f\n", trackLocal->airtemperature);
GfLogDebug("Dew point = %.3f\n", trackLocal->dewp);
GfLogDebug("Air pressure = %.3f\n", trackLocal->airpressure);
GfLogDebug("Air Density = %.3f\n", trackLocal->airdensity);
GfLogDebug("Rain = %i\n", trackLocal->rain);
GfLogDebug("Snow = %i\n", trackLocal->snow);
GfLogDebug("Hail = %i\n", trackLocal->hail);

View file

@ -82,6 +82,7 @@ ReWebMetar::ReWebMetar() :
_dewp(NaN),
_distance(NaN),
_pressure(NaN),
_density(NaN),
_rain(false),
_hail(false),
_snow(false),
@ -202,7 +203,6 @@ void ReWebMetar::ReWebMetarLoad(const string& m)
if (_grpcount < 4)
{
delete[] _data;
//throw sg_io_exception("metar data incomplete ", sg_location(_url));
}
_url = "";