CARLA
LibCarla/source/carla/rpc/WeatherParameters.h
Go to the documentation of this file.
1 // Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2 // de Barcelona (UAB).
3 //
4 // This work is licensed under the terms of the MIT license.
5 // For a copy, see <https://opensource.org/licenses/MIT>.
6 
7 #pragma once
8 
9 #include "carla/MsgPack.h"
10 
11 #ifdef LIBCARLA_INCLUDED_FROM_UE4
13 #endif // LIBCARLA_INCLUDED_FROM_UE4
14 
15 namespace carla {
16 namespace rpc {
17 
19  public:
20 
21  /// @name Weather presets
22  /// @{
23 
47 
48  /// @}
49 
50  WeatherParameters() = default;
51 
53  float in_cloudiness,
54  float in_precipitation,
55  float in_precipitation_deposits,
56  float in_wind_intensity,
57  float in_sun_azimuth_angle,
58  float in_sun_altitude_angle,
59  float in_fog_density,
60  float in_fog_distance,
61  float in_fog_falloff,
62  float in_wetness,
63  float in_scattering_intensity,
64  float in_mie_scattering_scale,
65  float in_rayleigh_scattering_scale,
66  float in_dust_storm)
67  : cloudiness(in_cloudiness),
68  precipitation(in_precipitation),
69  precipitation_deposits(in_precipitation_deposits),
70  wind_intensity(in_wind_intensity),
71  sun_azimuth_angle(in_sun_azimuth_angle),
72  sun_altitude_angle(in_sun_altitude_angle),
73  fog_density(in_fog_density),
74  fog_distance(in_fog_distance),
75  fog_falloff(in_fog_falloff),
76  wetness(in_wetness),
77  scattering_intensity(in_scattering_intensity),
78  mie_scattering_scale(in_mie_scattering_scale),
79  rayleigh_scattering_scale(in_rayleigh_scattering_scale),
80  dust_storm(in_dust_storm) {}
81 
82  float cloudiness = 0.0f;
83  float precipitation = 0.0f;
84  float precipitation_deposits = 0.0f;
85  float wind_intensity = 0.0f;
86  float sun_azimuth_angle = 0.0f;
87  float sun_altitude_angle = 0.0f;
88  float fog_density = 0.0f;
89  float fog_distance = 0.0f;
90  float fog_falloff = 0.0f;
91  float wetness = 0.0f;
92  float scattering_intensity = 0.0f;
93  float mie_scattering_scale = 0.0f;
94  float rayleigh_scattering_scale = 0.0331f;
95  float dust_storm = 0.0f;
96 
97 #ifdef LIBCARLA_INCLUDED_FROM_UE4
98 
100  : cloudiness(Weather.Cloudiness),
101  precipitation(Weather.Precipitation),
102  precipitation_deposits(Weather.PrecipitationDeposits),
103  wind_intensity(Weather.WindIntensity),
104  sun_azimuth_angle(Weather.SunAzimuthAngle),
105  sun_altitude_angle(Weather.SunAltitudeAngle),
106  fog_density(Weather.FogDensity),
107  fog_distance(Weather.FogDistance),
108  fog_falloff(Weather.FogFalloff),
109  wetness(Weather.Wetness),
110  scattering_intensity(Weather.ScatteringIntensity),
111  mie_scattering_scale(Weather.MieScatteringScale),
112  rayleigh_scattering_scale(Weather.RayleighScatteringScale),
113  dust_storm(Weather.DustStorm) {}
114 
115  operator FWeatherParameters() const {
116  FWeatherParameters Weather;
117  Weather.Cloudiness = cloudiness;
118  Weather.Precipitation = precipitation;
120  Weather.WindIntensity = wind_intensity;
123  Weather.FogDensity = fog_density;
124  Weather.FogDistance = fog_distance;
125  Weather.FogFalloff = fog_falloff;
126  Weather.Wetness = wetness;
130  Weather.DustStorm = dust_storm;
131  return Weather;
132  }
133 
134 #endif // LIBCARLA_INCLUDED_FROM_UE4
135 
136  bool operator!=(const WeatherParameters &rhs) const {
137  return
138  cloudiness != rhs.cloudiness ||
139  precipitation != rhs.precipitation ||
140  precipitation_deposits != rhs.precipitation_deposits ||
141  wind_intensity != rhs.wind_intensity ||
142  sun_azimuth_angle != rhs.sun_azimuth_angle ||
143  sun_altitude_angle != rhs.sun_altitude_angle ||
144  fog_density != rhs.fog_density ||
145  fog_distance != rhs.fog_distance ||
146  fog_falloff != rhs.fog_falloff ||
147  wetness != rhs.wetness ||
148  scattering_intensity != rhs.scattering_intensity ||
149  mie_scattering_scale != rhs.mie_scattering_scale ||
150  rayleigh_scattering_scale != rhs.rayleigh_scattering_scale ||
151  dust_storm != rhs.dust_storm;
152  }
153 
154  bool operator==(const WeatherParameters &rhs) const {
155  return !(*this != rhs);
156  }
157 
159  cloudiness,
160  precipitation,
161  precipitation_deposits,
162  wind_intensity,
163  sun_azimuth_angle,
164  sun_altitude_angle,
165  fog_density,
166  fog_distance,
167  fog_falloff,
168  wetness,
169  scattering_intensity,
170  mie_scattering_scale,
171  rayleigh_scattering_scale,
172  dust_storm);
173  };
174 
175 } // namespace rpc
176 } // namespace carla
MSGPACK_DEFINE_ARRAY(cloudiness, precipitation, precipitation_deposits, wind_intensity, sun_azimuth_angle, sun_altitude_angle, fog_density, fog_distance, fog_falloff, wetness, scattering_intensity, mie_scattering_scale, rayleigh_scattering_scale, dust_storm)
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
bool operator==(const WeatherParameters &rhs) const
WeatherParameters(float in_cloudiness, float in_precipitation, float in_precipitation_deposits, float in_wind_intensity, float in_sun_azimuth_angle, float in_sun_altitude_angle, float in_fog_density, float in_fog_distance, float in_fog_falloff, float in_wetness, float in_scattering_intensity, float in_mie_scattering_scale, float in_rayleigh_scattering_scale, float in_dust_storm)
bool operator!=(const WeatherParameters &rhs) const