From 7e406f0886d56625b195ba7f2843965d1371b5e6 Mon Sep 17 00:00:00 2001 From: torcs-ng Date: Sat, 4 May 2019 20:40:50 +0000 Subject: [PATCH] - Update weather git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6635 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 146b9c8806ab0098d3d62b935d7626fcf2e9f108 Former-commit-id: e5e9bc5508aae10fa122ac3ba5239d3f7e825255 --- src/modules/racing/standardgame/racetrack.cpp | 4 +++- src/modules/simu/simuv4/atmosphere.cpp | 20 +------------------ 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/modules/racing/standardgame/racetrack.cpp b/src/modules/racing/standardgame/racetrack.cpp index 5b19cbf61..c80268d26 100644 --- a/src/modules/racing/standardgame/racetrack.cpp +++ b/src/modules/racing/standardgame/racetrack.cpp @@ -408,7 +408,7 @@ reTrackInitWeather(void) trackLocal->water = water; trackLocal->airtemperature = 15.0f; trackLocal->dewp = 5.0f; - trackLocal->airpressure = 1125.0f; + trackLocal->airpressure = 101300; trackLocal->windspeed = rand() % 100; trackLocal->winddir = rand() % 359; trackLocal->relativehumidity = 65.0f; @@ -654,6 +654,8 @@ reTrackInitRealWeather(void) else trackLocal->airpressure = webMetar->getPressure_hPa(); + trackLocal->airpressure = trackLocal->airpressure * 100; + trackLocal->rain = webMetar->getRain(); trackLocal->snow = webMetar->getSnow(); trackLocal->hail = webMetar->getHail(); diff --git a/src/modules/simu/simuv4/atmosphere.cpp b/src/modules/simu/simuv4/atmosphere.cpp index fbe1acfef..b922e3c76 100644 --- a/src/modules/simu/simuv4/atmosphere.cpp +++ b/src/modules/simu/simuv4/atmosphere.cpp @@ -27,12 +27,11 @@ void SimAtmosphereConfig(tTrack *track) SimTimeOfDay = track->local.timeofday; SimClouds = track->local.clouds; Tair = track->local.airtemperature + 273.15; + SimAirPressure = track->local.airpressure; // Adapt air pressure with track elevation if (track->local.altitude < 500) { - SimAirPressure = 101300; - if (track->local.altitude < 100) SimAirDensity = 1.290f; else if (track->local.altitude < 200) @@ -45,8 +44,6 @@ void SimAtmosphereConfig(tTrack *track) } else if (track->local.altitude < 1000) { - SimAirPressure = 95400; - if (track->local.altitude < 600) SimAirDensity = 1.225f; else if (track->local.altitude < 700) @@ -59,8 +56,6 @@ void SimAtmosphereConfig(tTrack *track) } else if (track->local.altitude < 1500) { - SimAirPressure = 89800; - if (track->local.altitude < 1100) SimAirDensity = 1.167f; else if (track->local.altitude < 1200) @@ -73,8 +68,6 @@ void SimAtmosphereConfig(tTrack *track) } else if (track->local.altitude < 2000) { - SimAirPressure = 84600; - if (track->local.altitude < 1600) SimAirDensity = 1.112f; else if (track->local.altitude < 1700) @@ -87,7 +80,6 @@ void SimAtmosphereConfig(tTrack *track) } else { - SimAirPressure = 79400; SimAirDensity = 1.058f; } @@ -113,16 +105,6 @@ void SimAtmosphereConfig(tTrack *track) Tair -= 3.05; else Tair -= 5.75; - - if(SimRain == 0) - Tair = Tair; - else if (SimRain == 1) - Tair -= 1.55; - else if (SimRain == 2) - Tair -= 2.75; - else - Tair -= 3.50; - //Tair = 297.15; // 24 degree celsius }