8#include "CoreMinimal.h"
9#include "Engine/World.h"
10#include "GameFramework/GameUserSettings.h"
15#include "AgrarsenseSettings.generated.h"
27UCLASS(BlueprintType, Blueprintable)
34 UFUNCTION(BlueprintPure)
41 void Setup(UWorld* World);
43 virtual void PostInitProperties()
override;
48 void LoadSettings(
bool bForceReload =
false)
override;
50 void ApplySettings(
bool bCheckForCommandLineOverrides)
override;
61 void SetWindowMode(EWindowMode::Type WindowType);
74 UFUNCTION(BlueprintCallable)
75 void SetWorldRendering(
bool enabled);
81 UFUNCTION(BlueprintCallable)
88 UFUNCTION(BlueprintCallable)
89 void SetQualityLevelFromString(
const FString& QualityLevelString);
95 UFUNCTION(BlueprintCallable, BlueprintPure)
96 int GetGlobalTargetFrameRate()
const;
104 UFUNCTION(BlueprintCallable)
105 void SetGlobalTargetFrameRate(
int NewTargetFrameRate);
111 UFUNCTION(BlueprintCallable, BlueprintPure)
112 float GetGlobalTimeDilation()
const;
117 UFUNCTION(BlueprintCallable)
118 void SetSpectatorMaxSpeed(
float MaxSpeed);
123 UFUNCTION(BlueprintCallable)
124 void SetShowSpectatorRainAndSnowfall(
bool Show);
130 UFUNCTION(BlueprintCallable, BlueprintPure)
131 float GetSpectatorMaxSpeed()
const
133 return SimulationSettings.SpectatorMaxSpeed;
140 UFUNCTION(BlueprintCallable, BlueprintPure)
141 bool GetShowSpectatorRainAndSnowfall()
const
143 return SimulationSettings.ShowSpectatorRainAndSnowfall;
153 UFUNCTION(BlueprintCallable)
154 void SetGlobalTimeDilation(
float TimeDilation);
159 UFUNCTION(BlueprintCallable)
160 void PauseSimulation();
165 UFUNCTION(BlueprintCallable)
166 void UnPauseSimulation();
171 UFUNCTION(BlueprintCallable)
172 void PauseSimulationEndOfThisFrame();
178 UFUNCTION(BlueprintCallable)
179 void AdvanceFrameCount(int32 FramesToAdvance);
185 UFUNCTION(BlueprintCallable)
186 void AdvanceTime(
float TimeToAdvance);
193 UFUNCTION(BlueprintCallable)
194 void ChangeMapByName(FString MapName);
199 UFUNCTION(BlueprintCallable)
200 void ChangeMapByMapPath(
const FString& Path);
206 UFUNCTION(BlueprintCallable, BlueprintPure)
207 bool GetGrassVisibility()
const;
212 UFUNCTION(BlueprintCallable)
213 void SetGrassVisibility(
bool Visible);
219 UFUNCTION(BlueprintCallable, BlueprintPure)
220 bool GetShadowCSMCache()
const;
225 UFUNCTION(BlueprintCallable)
226 void SetShadowCSMCache(
bool CacheShadowCSM);
232 UFUNCTION(BlueprintCallable, BlueprintPure)
239 UFUNCTION(BlueprintCallable)
240 void SetAntiAliasingMethod(
EAntiAliasing AntiAliasingMethod);
246 UFUNCTION(BlueprintCallable)
247 void SetAntiAliasingMethodFromString(
const FString& AntiAliasingMethodString);
253 UFUNCTION(BlueprintCallable)
254 void SetInstancedRenderingVisibility(
bool Visible);
260 UFUNCTION(BlueprintCallable)
261 void SetWorldPositionOffsetRenderDistance(int32 WorldPositionOffsetDistance);
266 UFUNCTION(BlueprintCallable)
267 void SetNaniteMaxPixelsPerEdge(
float MaxPixelsPerEdge = 1.0f);
277 UFUNCTION(BlueprintCallable)
278 void SetShadowCacheInvalidationBehavior(EShadowCacheInvalidationBehavior Behaviour = EShadowCacheInvalidationBehavior::Rigid);
285 UFUNCTION(BlueprintCallable)
286 void SetShadowCacheInvalidationBehaviorFromString(
const FString& BehaviourString);
291 UFUNCTION(BlueprintCallable)
292 int32 GetWorldPositionOffsetRenderDistance()
const;
297 UFUNCTION(BlueprintCallable, BlueprintPure)
298 float GetNaniteMaxPixelsPerEdge()
const;
303 UFUNCTION(BlueprintCallable, BlueprintPure)
304 EShadowCacheInvalidationBehavior GetShadowCacheInvalidationBehavior()
const;
309 UFUNCTION(BlueprintCallable, BlueprintPure)
310 bool GetStartWindowInitiallyMinimized()
const;
315 UFUNCTION(BlueprintCallable)
316 void SetStartWindowInitiallyMinimized(
bool Minimized);
321 UFUNCTION(BlueprintCallable)
322 void SetRenderCustomDepthPass(
bool RenderCustomDepthPass);
327 UFUNCTION(BlueprintCallable)
328 void SetUseVirtualShadowMaps(
bool UseVirtualShadowMaps);
333 UFUNCTION(BlueprintCallable)
334 bool GetIsUsingVirtualShadowMaps()
const;
339 UFUNCTION(BlueprintCallable)
340 bool GetIsRenderingCustomDepthPass()
const;
345 UFUNCTION(BlueprintCallable)
346 int32 GetNumberOfWorkerThreads()
const;
352 UFUNCTION(BlueprintCallable)
353 FString GetConsoleVariableValueString(
const FString& VariableName)
const;
359 UFUNCTION(BlueprintPure)
362 return GraphicsSettings.QualityLevel;
369 UFUNCTION(BlueprintCallable)
370 TArray<FString> GetMapNames()
const
379 UFUNCTION(BlueprintCallable)
380 TArray<FString> GetMapPaths()
const
389 UPROPERTY(BlueprintAssignable)
390 FGraphicsSettingsDelegate OnGraphicsSettingsChanged;
396 static
bool ShouldStartWindowMinimized()
398 return GetAgrarsenseSettings()->SimulationSettings.StartCameraWindowsMinimized;
413 UFUNCTION(BlueprintPure)
416 return GetAgrarsenseSettings()->SimulationSettings;
422 UFUNCTION(BlueprintPure)
423 static
bool IsSimulationPaused()
431 UFUNCTION(BlueprintPure)
434 return GetAgrarsenseSettings()->GraphicsSettings;
444 bool ParseLaunchArguments();
447 void OnSensorSpawned(
ASensor* SensorPtr);
450 void OnSensorDestroyed(
ASensor* SensorPtr);
452 void SetUltraWithRaytracingLevel();
454 bool IsRaytracingSupported() const;
456 void EnableRaytracing();
458 void DisableRaytracing();
460 void SetUltraQualityLevel();
462 void SetBalancedQualityLevel();
464 void SetLowQualityLevel();
466 int NumberOfPostProcessingSensors = 0;
468 bool RenderCustomDepth = false;
471 TWeakObjectPtr<UWorld> CurrentWorld =
nullptr;
480 FDelegateHandle AdvanceFramesHandle;
481 int32 FrameCount = 0;
484 FDelegateHandle EndOfFrameHandle;
492 const TArray<FString> MapNames =
502 const TArray<FString> MapPaths =
504 "/Game/Agrarsense/Maps/MainMenu",
505 "/Game/Agrarsense/Maps/RovaniemiForest/RovaniemiForest",
506 "/Game/Agrarsense/Maps/Vindeln/Vindeln",
507 "/Game/Agrarsense/Maps/SensorShowCase/SensorShowCase",
508 "/Game/Agrarsense/Maps/Playground"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FGraphicsSettingsDelegate, FGlobalGraphicsSettings, GraphicsSettings)
static FString CurrentMapName
static bool IsPlayingInMainMenu()