Used to set settings for every actor that is spawned into the world. More...
#include <CarlaSettingsDelegate.h>
Public Member Functions | |
void | ApplyQualityLevelPostRestart () |
After loading a level, apply the current settings. More... | |
void | ApplyQualityLevelPreRestart () |
Before loading a level, apply the current settings. More... | |
void | RegisterSpawnHandler (UWorld *World) |
Create the event trigger handler for all the newly spawned actors to be processed with a custom function here. More... | |
void | Reset () |
Reset settings to default. More... | |
void | SetAllActorsDrawDistance (UWorld *world, float max_draw_distance) const |
UCarlaSettingsDelegate () | |
Private Member Functions | |
void | CheckCarlaSettings (UWorld *world) |
Check that the world, instance and settings are valid and save the CarlaSettings instance. More... | |
UWorld * | GetLocalWorld () |
void | LaunchEpicQualityCommands (UWorld *world) const |
Execute engine commands to apply the epic quality level to the world. More... | |
void | LaunchLowQualityCommands (UWorld *world) const |
Execute engine commands to apply the low quality level to the world. More... | |
void | OnActorSpawned (AActor *Actor) |
Function to apply to the actor that is being spawned to apply the current settings. More... | |
void | SetActorComponentsDrawDistance (AActor *actor, float max_draw_distance) const |
void | SetAllLights (UWorld *world, float max_distance_fade, bool cast_shadows, bool hide_non_directional) const |
void | SetAllRoads (UWorld *world, float max_draw_distance, const TArray< FStaticMaterial > &road_pieces_materials) const |
void | SetPostProcessEffectsEnabled (UWorld *world, bool enabled) const |
Private Attributes | |
FOnActorSpawned::FDelegate | ActorSpawnedDelegate |
UCarlaSettings * | CarlaSettings = nullptr |
Static Private Attributes | |
static EQualityLevel | AppliedLowPostResetQualityLevel = EQualityLevel::Epic |
Currently applied quality level after level is restarted. More... | |
Used to set settings for every actor that is spawned into the world.
Definition at line 21 of file CarlaSettingsDelegate.h.
UCarlaSettingsDelegate::UCarlaSettingsDelegate | ( | ) |
Definition at line 27 of file CarlaSettingsDelegate.cpp.
void UCarlaSettingsDelegate::ApplyQualityLevelPostRestart | ( | ) |
After loading a level, apply the current settings.
Definition at line 73 of file CarlaSettingsDelegate.cpp.
References AppliedLowPostResetQualityLevel, CarlaSettings, CheckCarlaSettings(), Epic, UCarlaSettings::GetQualityLevel(), LaunchEpicQualityCommands(), LaunchLowQualityCommands(), Low, UCarlaSettings::LowLightFadeDistance, SetAllActorsDrawDistance(), SetAllLights(), SetAllRoads(), and SetPostProcessEffectsEnabled().
Referenced by ACarlaGameModeBase::InitGame().
void UCarlaSettingsDelegate::ApplyQualityLevelPreRestart | ( | ) |
Before loading a level, apply the current settings.
Definition at line 120 of file CarlaSettingsDelegate.cpp.
References UCarlaSettings::bDisableRendering, CarlaSettings, CheckCarlaSettings(), and IsValid().
Referenced by ACarlaGameModeBase::RestartPlayer().
|
private |
Check that the world, instance and settings are valid and save the CarlaSettings instance.
world | used to get the instance of CarlaSettings. |
Definition at line 152 of file CarlaSettingsDelegate.cpp.
References CarlaSettings, GetLocalWorld(), and IsValid().
Referenced by ApplyQualityLevelPostRestart(), ApplyQualityLevelPreRestart(), and RegisterSpawnHandler().
|
private |
Definition at line 147 of file CarlaSettingsDelegate.cpp.
Referenced by CheckCarlaSettings().
|
private |
Execute engine commands to apply the epic quality level to the world.
Definition at line 371 of file CarlaSettingsDelegate.cpp.
Referenced by ApplyQualityLevelPostRestart().
|
private |
Execute engine commands to apply the low quality level to the world.
Definition at line 169 of file CarlaSettingsDelegate.cpp.
Referenced by ApplyQualityLevelPostRestart().
|
private |
Function to apply to the actor that is being spawned to apply the current settings.
Definition at line 43 of file CarlaSettingsDelegate.cpp.
References UCarlaSettings::CARLA_ROAD_TAG, CARLA_SETTINGS_MAX_SCALE_SIZE, UCarlaSettings::CARLA_SKY_TAG, CarlaSettings, UCarlaSettings::GetQualityLevel(), IsValid(), Low, and SetActorComponentsDrawDistance().
void UCarlaSettingsDelegate::RegisterSpawnHandler | ( | UWorld * | World | ) |
Create the event trigger handler for all the newly spawned actors to be processed with a custom function here.
Definition at line 37 of file CarlaSettingsDelegate.cpp.
References ActorSpawnedDelegate, and CheckCarlaSettings().
Referenced by ACarlaGameModeBase::InitGame().
void UCarlaSettingsDelegate::Reset | ( | void | ) |
Reset settings to default.
Definition at line 32 of file CarlaSettingsDelegate.cpp.
References AppliedLowPostResetQualityLevel, and Epic.
Referenced by ACarlaGameModeBase::EndPlay().
|
private |
Definition at line 291 of file CarlaSettingsDelegate.cpp.
References CARLA_SETTINGS_MAX_SCALE_SIZE, and IsValid().
Referenced by OnActorSpawned(), and SetAllActorsDrawDistance().
void UCarlaSettingsDelegate::SetAllActorsDrawDistance | ( | UWorld * | world, |
float | max_draw_distance | ||
) | const |
: use semantics to grab all actors by type (vehicles,ground,people,props) and set different distances configured in the global properties
Definition at line 318 of file CarlaSettingsDelegate.cpp.
References UCarlaSettings::CARLA_ROAD_TAG, UCarlaSettings::CARLA_SKY_TAG, IsValid(), and SetActorComponentsDrawDistance().
Referenced by ApplyQualityLevelPostRestart(), and ACarlaGameModeBase::OnEpisodeSettingsChanged().
|
private |
Definition at line 416 of file CarlaSettingsDelegate.cpp.
References IsValid().
Referenced by ApplyQualityLevelPostRestart().
|
private |
Definition at line 227 of file CarlaSettingsDelegate.cpp.
References UCarlaSettings::CARLA_ROAD_TAG, and IsValid().
Referenced by ApplyQualityLevelPostRestart().
|
private |
Definition at line 352 of file CarlaSettingsDelegate.cpp.
References IsValid().
Referenced by ApplyQualityLevelPostRestart().
|
private |
Definition at line 88 of file CarlaSettingsDelegate.h.
Referenced by RegisterSpawnHandler().
|
staticprivate |
Currently applied quality level after level is restarted.
quality settings configuration between runs
Definition at line 84 of file CarlaSettingsDelegate.h.
Referenced by ApplyQualityLevelPostRestart(), and Reset().
|
private |
Definition at line 86 of file CarlaSettingsDelegate.h.
Referenced by ApplyQualityLevelPostRestart(), ApplyQualityLevelPreRestart(), CheckCarlaSettings(), and OnActorSpawned().