10#include "Components/SceneCaptureComponent2D.h"
11#include "Kismet/GameplayStatics.h"
12#include "ConstructorHelpers.h"
16 : Super(ObjectInitializer)
21 TEXT(
"Material'/Game/Carla/Static/GenericMaterials/00_MastersOpt/Screen_posProcess/M_screenDrops.M_screenDrops'")).Object;
26 TEXT(
"Material'/Game/Carla/Static/GenericMaterials/00_MastersOpt/Screen_posProcess/M_screenDust_wind.M_screenDust_wind'")).Object;
29 PrimaryActorTick.bCanEverTick =
false;
31 RootComponent = ObjectInitializer.CreateDefaultSubobject<USceneComponent>(
this, TEXT(
"RootComponent"));
54 TArray<AActor*> SensorActors;
56 UGameplayStatics::GetAllActorsOfClass(GetWorld(), ASceneCaptureCamera::StaticClass(), SensorActors);
58 for (
AActor* SensorActor : SensorActors)
65 Sensor->
GetCaptureComponent2D()->PostProcessSettings.AddBlendable(ActiveBlendable.Key, ActiveBlendable.Value);
77#ifdef CARLA_WEATHER_EXTRA_LOG
79 UE_LOG(LogCarla, Log, TEXT(
"Changing weather:"));
UE_LOG(LogCarla, Log, TEXT("UActorDispatcher::Destroying actor: '%s' %x"), *Id, Actor)
A sensor that captures images from the scene.
USceneCaptureComponent2D * GetCaptureComponent2D()
void SetWeather(const FWeatherParameters &WeatherParameters)
在不通知蓝图事件的情况下更新天气参数
FWeatherParameters Weather
void SetDayNightCycle(const bool &active)
更新昼夜周期
void ApplyWeather(const FWeatherParameters &WeatherParameters)
更新天气参数并将其通知到蓝图的事件
UMaterial * PrecipitationPostProcessMaterial
void CheckWeatherPostProcessEffects()
AWeather(const FObjectInitializer &ObjectInitializer)
void NotifyWeather(ASensor *Sensor=nullptr)
将天气通知到蓝图的事件
UMaterial * DustStormPostProcessMaterial
void RefreshWeather(const FWeatherParameters &WeatherParameters)
TMap< UMaterial *, float > ActiveBlendables
float RayleighScatteringScale
float PrecipitationDeposits
float ScatteringIntensity