CARLA
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
UCarlaSettings Class Reference

Global settings for CARLA. More...

#include <CarlaSettings.h>

+ Inheritance diagram for UCarlaSettings:
+ Collaboration diagram for UCarlaSettings:

Public Member Functions

EQualityLevel GetQualityLevel () const
 
void LoadSettings ()
 Load the settings based on the command-line arguments and the INI file if provided. More...
 
void LoadSettingsFromString (const FString &INIFileContents)
 Load the settings from the given string (formatted as INI). More...
 
void LogSettings () const
 Log settings values. More...
 
void SetQualityLevel (EQualityLevel InQualityLevel)
 Sets the new quality settings level and make changes in the game related to it. More...
 

Public Attributes

CARLA Server
uint32 RPCPort = 2000u
 World port to listen for client connections. More...
 
TOptional< uint32 > StreamingPort
 Optional setting for the secondary port. More...
 
bool bSynchronousMode = false
 In synchronous mode, CARLA waits every tick until the control from the client is received. More...
 
bool bDisableRendering = false
 Enable or disable the viewport rendering of the world. More...
 

Static Public Attributes

static const FName CARLA_ROAD_TAG = FName("CARLA_ROAD")
 CARLA_ROAD name to tag road mesh actors. More...
 
static const FName CARLA_SKY_TAG = FName("CARLA_SKY")
 CARLA_SKY name to tag the sky sphere (BPS) actors in the scenes. More...
 

Private Member Functions

void LoadSettingsFromFile (const FString &FilePath, bool bLogOnFailure)
 

Private Attributes

FString CurrentFileName
 File name of the settings file used to load this settings. More...
 

Quality Settings

EQualityLevel QualityLevel = EQualityLevel::Epic
 Quality Settings level. More...
 
float LowLightFadeDistance = 1000.0f
 Distance at which the light function should be completely faded to DisabledBrightness. More...
 
 UPROPERTY (Category="Quality Settings/Low", BlueprintReadOnly, EditAnywhere, config, DisplayName="Road Materials List for Low Quality") TArray< FStaticMaterial > LowRoadMaterials
 Low quality Road Materials. More...
 
 UPROPERTY (Category="Quality Settings/Low", BlueprintReadOnly, EditAnywhere, config, meta=(ClampMin="5000.0", ClampMax="20000.0", UIMin="5000.0", UIMax="20000.0")) float LowStaticMeshMaxDrawDistance
 Default low distance for all primitive components. More...
 
 UPROPERTY (Category="Quality Settings/Low", BlueprintReadOnly, EditAnywhere, config, meta=(ClampMin="5000.0", ClampMax="20000.0", UIMin="5000.0", UIMax="20000.0")) float LowRoadPieceMeshMaxDrawDistance
 Default low distance for roads meshes. More...
 
 UPROPERTY (Category="Quality Settings/Epic", BlueprintReadOnly, EditAnywhere, config, DisplayName="Road Materials List for EPIC Quality") TArray< FStaticMaterial > EpicRoadMaterials
 EPIC quality Road Materials. More...
 

Detailed Description

Global settings for CARLA.

Setting object used to hold both config settings and editable ones in one place. To ensure the settings are saved to the specified config file make sure to add props using the globalconfig or config meta.

Definition at line 21 of file CarlaSettings.h.

Member Function Documentation

◆ GetQualityLevel()

EQualityLevel UCarlaSettings::GetQualityLevel ( ) const
inline
Returns
current quality settings level (could not have been applied yet).

Definition at line 41 of file CarlaSettings.h.

Referenced by UCarlaSettingsDelegate::ApplyQualityLevelPostRestart(), and UCarlaSettingsDelegate::OnActorSpawned().

+ Here is the caller graph for this function:

◆ LoadSettings()

void UCarlaSettings::LoadSettings ( )

Load the settings based on the command-line arguments and the INI file if provided.

Definition at line 99 of file CarlaSettings.cpp.

References bDisableRendering, CurrentFileName, Epic, carla::client::detail::Get(), GetSettingsFilePathFromCommandLine(), LoadSettingsFromFile(), QualityLevel, QualityLevelFromString(), RPCPort, and StreamingPort.

Referenced by UCarlaGameInstance::UCarlaGameInstance().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadSettingsFromFile()

void UCarlaSettings::LoadSettingsFromFile ( const FString &  FilePath,
bool  bLogOnFailure 
)
private

Definition at line 168 of file CarlaSettings.cpp.

References CurrentFileName, and LoadSettingsFromConfig().

Referenced by LoadSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LoadSettingsFromString()

void UCarlaSettings::LoadSettingsFromString ( const FString &  INIFileContents)

Load the settings from the given string (formatted as INI).

CarlaServer section is ignored.

Definition at line 138 of file CarlaSettings.cpp.

References CurrentFileName, LoadSettingsFromConfig(), and FIniFile::ProcessInputFileContents().

+ Here is the call graph for this function:

◆ LogSettings()

void UCarlaSettings::LogSettings ( ) const

Log settings values.

Definition at line 148 of file CarlaSettings.cpp.

References bDisableRendering, bSynchronousMode, CurrentFileName, QualityLevel, QualityLevelToString(), RPCPort, S_CARLA_QUALITYSETTINGS, S_CARLA_SERVER, and StreamingPort.

Referenced by UCarlaGameInstance::UCarlaGameInstance().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetQualityLevel()

void UCarlaSettings::SetQualityLevel ( EQualityLevel  InQualityLevel)
inline

Sets the new quality settings level and make changes in the game related to it.

Note
This will not apply the quality settings. Use ApplyQualitySettings functions instead
Parameters
InQualityLevelStore the new quality.

Definition at line 34 of file CarlaSettings.h.

Referenced by LoadSettingsFromConfig().

+ Here is the caller graph for this function:

◆ UPROPERTY() [1/4]

UCarlaSettings::UPROPERTY ( Category  = "Quality Settings/Low",
BlueprintReadOnly  ,
EditAnywhere  ,
config  ,
DisplayName  = "Road Materials List for Low Quality" 
)

Low quality Road Materials.

Uses slots name to set material for each part of the road for low quality.

Todo:
Move Low quality vars to a generic map of structs with the quality level as key.

Referenced by UCarlaGameInstance::GetCurrentMapLayer().

+ Here is the caller graph for this function:

◆ UPROPERTY() [2/4]

UCarlaSettings::UPROPERTY ( Category  = "Quality Settings/Low",
BlueprintReadOnly  ,
EditAnywhere  ,
config  ,
meta  = (ClampMin="5000.0", ClampMax="20000.0", UIMin="5000.0", UIMax="20000.0") 
)

Default low distance for all primitive components.

◆ UPROPERTY() [3/4]

UCarlaSettings::UPROPERTY ( Category  = "Quality Settings/Low",
BlueprintReadOnly  ,
EditAnywhere  ,
config  ,
meta  = (ClampMin="5000.0", ClampMax="20000.0", UIMin="5000.0", UIMax="20000.0") 
)

Default low distance for roads meshes.

◆ UPROPERTY() [4/4]

UCarlaSettings::UPROPERTY ( Category  = "Quality Settings/Epic",
BlueprintReadOnly  ,
EditAnywhere  ,
config  ,
DisplayName  = "Road Materials List for EPIC Quality" 
)

EPIC quality Road Materials.

Uses slots name to set material for each part of the road for Epic quality.

Member Data Documentation

◆ bDisableRendering

bool UCarlaSettings::bDisableRendering = false

Enable or disable the viewport rendering of the world.

Disabled by default.

Definition at line 96 of file CarlaSettings.h.

Referenced by UCarlaSettingsDelegate::ApplyQualityLevelPreRestart(), LoadSettings(), LoadSettingsFromConfig(), and LogSettings().

◆ bSynchronousMode

bool UCarlaSettings::bSynchronousMode = false

In synchronous mode, CARLA waits every tick until the control from the client is received.

Definition at line 91 of file CarlaSettings.h.

Referenced by LoadSettingsFromConfig(), and LogSettings().

◆ CARLA_ROAD_TAG

const FName UCarlaSettings::CARLA_ROAD_TAG = FName("CARLA_ROAD")
static

◆ CARLA_SKY_TAG

const FName UCarlaSettings::CARLA_SKY_TAG = FName("CARLA_SKY")
static

CARLA_SKY name to tag the sky sphere (BPS) actors in the scenes.

Definition at line 63 of file CarlaSettings.h.

Referenced by UCarlaSettingsDelegate::OnActorSpawned(), and UCarlaSettingsDelegate::SetAllActorsDrawDistance().

◆ CurrentFileName

FString UCarlaSettings::CurrentFileName
private

File name of the settings file used to load this settings.

Empty if none used.

Definition at line 72 of file CarlaSettings.h.

Referenced by LoadSettings(), LoadSettingsFromFile(), LoadSettingsFromString(), and LogSettings().

◆ LowLightFadeDistance

float UCarlaSettings::LowLightFadeDistance = 1000.0f

Distance at which the light function should be completely faded to DisabledBrightness.

This is useful for hiding aliasing from light functions applied in the distance.

Definition at line 127 of file CarlaSettings.h.

Referenced by UCarlaSettingsDelegate::ApplyQualityLevelPostRestart().

◆ QualityLevel

EQualityLevel UCarlaSettings::QualityLevel = EQualityLevel::Epic
private

Quality Settings level.

Definition at line 107 of file CarlaSettings.h.

Referenced by LoadSettings(), and LogSettings().

◆ RPCPort

uint32 UCarlaSettings::RPCPort = 2000u

World port to listen for client connections.

Definition at line 83 of file CarlaSettings.h.

Referenced by LoadSettings(), LoadSettingsFromConfig(), LogSettings(), and FCarlaEngine::NotifyInitGame().

◆ StreamingPort

TOptional<uint32> UCarlaSettings::StreamingPort

Optional setting for the secondary port.

Definition at line 86 of file CarlaSettings.h.

Referenced by LoadSettings(), LogSettings(), and FCarlaEngine::NotifyInitGame().


The documentation for this class was generated from the following files: