Fixed fog_falloff in Boost Python

This commit is contained in:
Marc Garcia Puig 2020-06-09 11:38:50 +02:00
parent c29a1908e9
commit 97cb2dfec0
3 changed files with 20 additions and 18 deletions

View File

@ -11,22 +11,22 @@ namespace rpc {
using WP = WeatherParameters;
// cloudiness precip. prec.dep. wind azimuth altitude fog dens. fog dist wetness
WP WP::Default = { -1.0f, -1.0f, -1.0f, -1.00f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f};
WP WP::ClearNoon = { 15.0f, 0.0f, 0.0f, 0.35f, 0.0f, 75.0f, 0.0f, 0.0f, 0.0f};
WP WP::CloudyNoon = { 80.0f, 0.0f, 0.0f, 0.35f, 0.0f, 75.0f, 0.0f, 0.0f, 0.0f};
WP WP::WetNoon = { 20.0f, 0.0f, 50.0f, 0.35f, 0.0f, 75.0f, 0.0f, 0.0f, 0.0f};
WP WP::WetCloudyNoon = { 80.0f, 0.0f, 50.0f, 0.35f, 0.0f, 75.0f, 0.0f, 0.0f, 0.0f};
WP WP::MidRainyNoon = { 80.0f, 30.0f, 50.0f, 0.40f, 0.0f, 75.0f, 0.0f, 0.0f, 0.0f};
WP WP::HardRainNoon = { 90.0f, 60.0f, 100.0f, 1.00f, 0.0f, 75.0f, 0.0f, 0.0f, 0.0f};
WP WP::SoftRainNoon = { 70.0f, 15.0f, 50.0f, 0.35f, 0.0f, 75.0f, 0.0f, 0.0f, 0.0f};
WP WP::ClearSunset = { 15.0f, 0.0f, 0.0f, 0.35f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f};
WP WP::CloudySunset = { 80.0f, 0.0f, 0.0f, 0.35f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f};
WP WP::WetSunset = { 20.0f, 0.0f, 50.0f, 0.35f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f};
WP WP::WetCloudySunset = { 90.0f, 0.0f, 50.0f, 0.35f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f};
WP WP::MidRainSunset = { 80.0f, 30.0f, 50.0f, 0.40f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f};
WP WP::HardRainSunset = { 80.0f, 60.0f, 100.0f, 1.00f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f};
WP WP::SoftRainSunset = { 90.0f, 15.0f, 50.0f, 0.35f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f};
// cloudiness precip. prec.dep. wind azimuth altitude fog dens fog dist fog fall wetness
WP WP::Default = { -1.0f, -1.0f, -1.0f, -1.00f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f};
WP WP::ClearNoon = { 15.0f, 0.0f, 0.0f, 0.35f, 0.0f, 75.0f, 0.0f, 0.0f, 0.0f, 0.0f};
WP WP::CloudyNoon = { 80.0f, 0.0f, 0.0f, 0.35f, 0.0f, 75.0f, 0.0f, 0.0f, 0.0f, 0.0f};
WP WP::WetNoon = { 20.0f, 0.0f, 50.0f, 0.35f, 0.0f, 75.0f, 0.0f, 0.0f, 0.0f, 0.0f};
WP WP::WetCloudyNoon = { 80.0f, 0.0f, 50.0f, 0.35f, 0.0f, 75.0f, 0.0f, 0.0f, 0.0f, 0.0f};
WP WP::MidRainyNoon = { 80.0f, 30.0f, 50.0f, 0.40f, 0.0f, 75.0f, 0.0f, 0.0f, 0.0f, 0.0f};
WP WP::HardRainNoon = { 90.0f, 60.0f, 100.0f, 1.00f, 0.0f, 75.0f, 0.0f, 0.0f, 0.0f, 0.0f};
WP WP::SoftRainNoon = { 70.0f, 15.0f, 50.0f, 0.35f, 0.0f, 75.0f, 0.0f, 0.0f, 0.0f, 0.0f};
WP WP::ClearSunset = { 15.0f, 0.0f, 0.0f, 0.35f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f, 0.0f};
WP WP::CloudySunset = { 80.0f, 0.0f, 0.0f, 0.35f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f, 0.0f};
WP WP::WetSunset = { 20.0f, 0.0f, 50.0f, 0.35f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f, 0.0f};
WP WP::WetCloudySunset = { 90.0f, 0.0f, 50.0f, 0.35f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f, 0.0f};
WP WP::MidRainSunset = { 80.0f, 30.0f, 50.0f, 0.40f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f, 0.0f};
WP WP::HardRainSunset = { 80.0f, 60.0f, 100.0f, 1.00f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f, 0.0f};
WP WP::SoftRainSunset = { 90.0f, 15.0f, 50.0f, 0.35f, 0.0f, 15.0f, 0.0f, 0.0f, 0.0f, 0.0f};
} // namespace rpc
} // namespace carla

View File

@ -29,7 +29,7 @@ void export_weather() {
namespace cr = carla::rpc;
auto cls = class_<cr::WeatherParameters>("WeatherParameters")
.def(init<float, float, float, float, float, float, float, float, float>(
.def(init<float, float, float, float, float, float, float, float, float, float>(
(arg("cloudiness")=0.0f,
arg("precipitation")=0.0f,
arg("precipitation_deposits")=0.0f,
@ -38,7 +38,7 @@ void export_weather() {
arg("sun_altitude_angle")=0.0f,
arg("fog_density")=0.0f,
arg("fog_distance")=0.0f,
arg("fog_falloff")=0.2f,
arg("fog_falloff")=0.0f,
arg("wetness")=0.0f)))
.def_readwrite("cloudiness", &cr::WeatherParameters::cloudiness)
.def_readwrite("precipitation", &cr::WeatherParameters::precipitation)
@ -48,6 +48,7 @@ void export_weather() {
.def_readwrite("sun_altitude_angle", &cr::WeatherParameters::sun_altitude_angle)
.def_readwrite("fog_density", &cr::WeatherParameters::fog_density)
.def_readwrite("fog_distance", &cr::WeatherParameters::fog_distance)
.def_readwrite("fog_falloff", &cr::WeatherParameters::fog_falloff)
.def_readwrite("wetness", &cr::WeatherParameters::wetness)
.def("__eq__", &cr::WeatherParameters::operator==)
.def("__ne__", &cr::WeatherParameters::operator!=)

View File

@ -28,6 +28,7 @@ void AWeather::ApplyWeather(const FWeatherParameters &InWeather)
UE_LOG(LogCarla, Log, TEXT(" - SunAltitudeAngle = %.2f"), Weather.SunAltitudeAngle);
UE_LOG(LogCarla, Log, TEXT(" - FogDensity = %.2f"), Weather.FogDensity);
UE_LOG(LogCarla, Log, TEXT(" - FogDistance = %.2f"), Weather.FogDistance);
UE_LOG(LogCarla, Log, TEXT(" - FogFalloff = %.2f"), Weather.FogFalloff);
UE_LOG(LogCarla, Log, TEXT(" - Wetness = %.2f"), Weather.Wetness);
#endif // CARLA_WEATHER_EXTRA_LOG