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
15 #endif // LIBCARLA_INCLUDED_FROM_UE4
16 
17 namespace carla {
18 namespace rpc {
19 
21  public:
22 
23  /// @name Weather presets
24  /// @{
25 
49 
50  /// @}
51 
52  WeatherParameters() = default;
53 
55  float in_cloudiness,
56  float in_precipitation,
57  float in_precipitation_deposits,
58  float in_wind_intensity,
59  float in_sun_azimuth_angle,
60  float in_sun_altitude_angle,
61  float in_fog_density,
62  float in_fog_distance,
63  float in_fog_falloff,
64  float in_wetness,
65  float in_scattering_intensity,
66  float in_mie_scattering_scale,
67  float in_rayleigh_scattering_scale,
68  float in_dust_storm)
69  : cloudiness(in_cloudiness),
70  precipitation(in_precipitation),
71  precipitation_deposits(in_precipitation_deposits),
72  wind_intensity(in_wind_intensity),
73  sun_azimuth_angle(in_sun_azimuth_angle),
74  sun_altitude_angle(in_sun_altitude_angle),
75  fog_density(in_fog_density),
76  fog_distance(in_fog_distance),
77  fog_falloff(in_fog_falloff),
78  wetness(in_wetness),
79  scattering_intensity(in_scattering_intensity),
80  mie_scattering_scale(in_mie_scattering_scale),
81  rayleigh_scattering_scale(in_rayleigh_scattering_scale),
82  dust_storm(in_dust_storm) {}
83 
84  float cloudiness = 0.0f;
85  float precipitation = 0.0f;
86  float precipitation_deposits = 0.0f;
87  float wind_intensity = 0.0f;
88  float sun_azimuth_angle = 0.0f;
89  float sun_altitude_angle = 0.0f;
90  float fog_density = 0.0f;
91  float fog_distance = 0.0f;
92  float fog_falloff = 0.0f;
93  float wetness = 0.0f;
94  float scattering_intensity = 0.0f;
95  float mie_scattering_scale = 0.0f;
96  float rayleigh_scattering_scale = 0.0331f;
97  float dust_storm = 0.0f;
98 
99 #ifdef LIBCARLA_INCLUDED_FROM_UE4
100 
101  WeatherParameters(const FWeatherParameters &Weather)
102  : cloudiness(Weather.Cloudiness),
103  precipitation(Weather.Precipitation),
104  precipitation_deposits(Weather.PrecipitationDeposits),
105  wind_intensity(Weather.WindIntensity),
106  sun_azimuth_angle(Weather.SunAzimuthAngle),
107  sun_altitude_angle(Weather.SunAltitudeAngle),
108  fog_density(Weather.FogDensity),
109  fog_distance(Weather.FogDistance),
110  fog_falloff(Weather.FogFalloff),
111  wetness(Weather.Wetness),
112  scattering_intensity(Weather.ScatteringIntensity),
113  mie_scattering_scale(Weather.MieScatteringScale),
114  rayleigh_scattering_scale(Weather.RayleighScatteringScale),
115  dust_storm(Weather.DustStorm) {}
116 
117  operator FWeatherParameters() const {
118  FWeatherParameters Weather;
119  Weather.Cloudiness = cloudiness;
120  Weather.Precipitation = precipitation;
122  Weather.WindIntensity = wind_intensity;
125  Weather.FogDensity = fog_density;
126  Weather.FogDistance = fog_distance;
127  Weather.FogFalloff = fog_falloff;
128  Weather.Wetness = wetness;
132  Weather.DustStorm = dust_storm;
133  return Weather;
134  }
135 
136 #endif // LIBCARLA_INCLUDED_FROM_UE4
137 
138  bool operator!=(const WeatherParameters &rhs) const {
139  return
140  cloudiness != rhs.cloudiness ||
141  precipitation != rhs.precipitation ||
142  precipitation_deposits != rhs.precipitation_deposits ||
143  wind_intensity != rhs.wind_intensity ||
144  sun_azimuth_angle != rhs.sun_azimuth_angle ||
145  sun_altitude_angle != rhs.sun_altitude_angle ||
146  fog_density != rhs.fog_density ||
147  fog_distance != rhs.fog_distance ||
148  fog_falloff != rhs.fog_falloff ||
149  wetness != rhs.wetness ||
150  scattering_intensity != rhs.scattering_intensity ||
151  mie_scattering_scale != rhs.mie_scattering_scale ||
152  rayleigh_scattering_scale != rhs.rayleigh_scattering_scale ||
153  dust_storm != rhs.dust_storm;
154  }
155 
156  bool operator==(const WeatherParameters &rhs) const {
157  return !(*this != rhs);
158  }
159 
161  cloudiness,
162  precipitation,
163  precipitation_deposits,
164  wind_intensity,
165  sun_azimuth_angle,
166  sun_altitude_angle,
167  fog_density,
168  fog_distance,
169  fog_falloff,
170  wetness,
171  scattering_intensity,
172  mie_scattering_scale,
173  rayleigh_scattering_scale,
174  dust_storm);
175  };
176 
177 } // namespace rpc
178 } // 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