CARLA
Weather.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 "GameFramework/Actor.h"
10 
12 
13 #include "Weather.generated.h"
14 
15 UCLASS(Abstract)
16 class CARLA_API AWeather : public AActor
17 {
18  GENERATED_BODY()
19 
20 public:
21 
22  AWeather(const FObjectInitializer& ObjectInitializer);
23 
24  /// Update the weather parameters and notifies it to the blueprint's event
25  UFUNCTION(BlueprintCallable)
26  void ApplyWeather(const FWeatherParameters &WeatherParameters);
27 
28  /// Notifing the weather to the blueprint's event
29  void NotifyWeather();
30 
31  /// Update the weather parameters without notifing it to the blueprint's event
32  UFUNCTION(BlueprintCallable)
33  void SetWeather(const FWeatherParameters &WeatherParameters);
34 
35  /// Returns the current WeatherParameters
36  UFUNCTION(BlueprintCallable)
37  const FWeatherParameters &GetCurrentWeather() const
38  {
39  return Weather;
40  }
41 
42  /// Returns whether the day night cycle is active (automatic on/off switch when changin to night mode)
43  UFUNCTION(BlueprintCallable)
44  const bool &GetDayNightCycle() const
45  {
46  return DayNightCycle;
47  }
48 
49  /// Update the day night cycle
50  void SetDayNightCycle(const bool &active);
51 
52 protected:
53 
54  UFUNCTION(BlueprintImplementableEvent)
55  void RefreshWeather(const FWeatherParameters &WeatherParameters);
56 
57 private:
58 
59  UPROPERTY(VisibleAnywhere)
61 
62  UPROPERTY(EditAnywhere, Category = "Weather")
63  bool DayNightCycle = true;
64 };