CARLA
Weather.cpp
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 #include "Carla.h"
9 
10 AWeather::AWeather(const FObjectInitializer& ObjectInitializer)
11  : Super(ObjectInitializer)
12 {
13  PrimaryActorTick.bCanEverTick = false;
14  RootComponent = ObjectInitializer.CreateDefaultSubobject<USceneComponent>(this, TEXT("RootComponent"));
15 }
16 
18 {
19  SetWeather(InWeather);
20 
21 #ifdef CARLA_WEATHER_EXTRA_LOG
22  UE_LOG(LogCarla, Log, TEXT("Changing weather:"));
23  UE_LOG(LogCarla, Log, TEXT(" - Cloudiness = %.2f"), Weather.Cloudiness);
24  UE_LOG(LogCarla, Log, TEXT(" - Precipitation = %.2f"), Weather.Precipitation);
25  UE_LOG(LogCarla, Log, TEXT(" - PrecipitationDeposits = %.2f"), Weather.PrecipitationDeposits);
26  UE_LOG(LogCarla, Log, TEXT(" - WindIntensity = %.2f"), Weather.WindIntensity);
27  UE_LOG(LogCarla, Log, TEXT(" - SunAzimuthAngle = %.2f"), Weather.SunAzimuthAngle);
28  UE_LOG(LogCarla, Log, TEXT(" - SunAltitudeAngle = %.2f"), Weather.SunAltitudeAngle);
29  UE_LOG(LogCarla, Log, TEXT(" - FogDensity = %.2f"), Weather.FogDensity);
30  UE_LOG(LogCarla, Log, TEXT(" - FogDistance = %.2f"), Weather.FogDistance);
31  UE_LOG(LogCarla, Log, TEXT(" - FogFalloff = %.2f"), Weather.FogFalloff);
32  UE_LOG(LogCarla, Log, TEXT(" - Wetness = %.2f"), Weather.Wetness);
33  UE_LOG(LogCarla, Log, TEXT(" - ScatteringIntensity = %.2f"), Weather.ScatteringIntensity);
34  UE_LOG(LogCarla, Log, TEXT(" - MieScatteringScale = %.2f"), Weather.MieScatteringScale);
35  UE_LOG(LogCarla, Log, TEXT(" - RayleighScatteringScale = %.2f"), Weather.RayleighScatteringScale);
36 #endif // CARLA_WEATHER_EXTRA_LOG
37 
38  // Call the blueprint that actually changes the weather.
40 }
41 
43 {
44  // Call the blueprint that actually changes the weather.
46 }
47 
49 {
50  Weather = InWeather;
51 }
void RefreshWeather(const FWeatherParameters &WeatherParameters)
void NotifyWeather()
Notifing the weather to the blueprint&#39;s event.
Definition: Weather.cpp:42
FWeatherParameters Weather
Definition: Weather.h:50
AWeather(const FObjectInitializer &ObjectInitializer)
Definition: Weather.cpp:10
void SetWeather(const FWeatherParameters &WeatherParameters)
Update the weather parameters without notifing it to the blueprint&#39;s event.
Definition: Weather.cpp:48
void ApplyWeather(const FWeatherParameters &WeatherParameters)
Update the weather parameters and notifies it to the blueprint&#39;s event.
Definition: Weather.cpp:17