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;
55 void SetWindowMode(EWindowMode::Type WindowType);
68 UFUNCTION(BlueprintCallable)
69 void SetWorldRendering(
bool enabled);
75 UFUNCTION(BlueprintCallable)
82 UFUNCTION(BlueprintCallable)
83 void SetQualityLevelFromString(
const FString& QualityLevelString);
89 UFUNCTION(BlueprintCallable, BlueprintPure)
90 int GetGlobalTargetFrameRate()
const;
98 UFUNCTION(BlueprintCallable)
99 void SetGlobalTargetFrameRate(
int NewTargetFrameRate);
105 UFUNCTION(BlueprintCallable, BlueprintPure)
106 float GetGlobalTimeDilation()
const;
111 UFUNCTION(BlueprintCallable)
112 void SetSpectatorMaxSpeed(
float MaxSpeed);
117 UFUNCTION(BlueprintCallable)
118 void SetShowSpectatorRainAndSnowfall(
bool Show);
124 UFUNCTION(BlueprintCallable, BlueprintPure)
125 float GetSpectatorMaxSpeed()
const
127 return SimulationSettings.SpectatorMaxSpeed;
134 UFUNCTION(BlueprintCallable, BlueprintPure)
135 bool GetShowSpectatorRainAndSnowfall()
const
137 return SimulationSettings.ShowSpectatorRainAndSnowfall;
147 UFUNCTION(BlueprintCallable)
148 void SetGlobalTimeDilation(
float TimeDilation);
153 UFUNCTION(BlueprintCallable)
154 void PauseSimulation();
159 UFUNCTION(BlueprintCallable)
160 void UnPauseSimulation();
165 UFUNCTION(BlueprintCallable)
166 void PauseSimulationEndOfThisFrame();
172 UFUNCTION(BlueprintCallable)
173 void AdvanceFrameCount(int32 FramesToAdvance);
179 UFUNCTION(BlueprintCallable)
180 void AdvanceTime(
float TimeToAdvance);
187 UFUNCTION(BlueprintCallable)
188 void ChangeMapByName(FString MapName);
193 UFUNCTION(BlueprintCallable)
194 void ChangeMapByMapPath(
const FString& Path);
200 UFUNCTION(BlueprintCallable, BlueprintPure)
201 bool GetGrassVisibility()
const;
206 UFUNCTION(BlueprintCallable)
207 void SetGrassVisibility(
bool Visible);
213 UFUNCTION(BlueprintCallable, BlueprintPure)
214 bool GetShadowCSMCache()
const;
219 UFUNCTION(BlueprintCallable)
220 void SetShadowCSMCache(
bool CacheShadowCSM);
226 UFUNCTION(BlueprintCallable, BlueprintPure)
233 UFUNCTION(BlueprintCallable)
234 void SetAntiAliasingMethod(
EAntiAliasing AntiAliasingMethod);
240 UFUNCTION(BlueprintCallable)
241 void SetAntiAliasingMethodFromString(
const FString& AntiAliasingMethodString);
247 UFUNCTION(BlueprintCallable)
248 void SetInstancedRenderingVisibility(
bool Visible);
254 UFUNCTION(BlueprintCallable)
255 void SetWorldPositionOffsetRenderDistance(int32 WorldPositionOffsetDistance);
260 UFUNCTION(BlueprintCallable)
261 void SetNaniteMaxPixelsPerEdge(
float MaxPixelsPerEdge = 1.0f);
271 UFUNCTION(BlueprintCallable)
272 void SetShadowCacheInvalidationBehavior(EShadowCacheInvalidationBehavior Behaviour = EShadowCacheInvalidationBehavior::Rigid);
279 UFUNCTION(BlueprintCallable)
280 void SetShadowCacheInvalidationBehaviorFromString(
const FString& BehaviourString);
285 UFUNCTION(BlueprintCallable)
286 int32 GetWorldPositionOffsetRenderDistance()
const;
291 UFUNCTION(BlueprintCallable, BlueprintPure)
292 float GetNaniteMaxPixelsPerEdge()
const;
297 UFUNCTION(BlueprintCallable, BlueprintPure)
298 EShadowCacheInvalidationBehavior GetShadowCacheInvalidationBehavior()
const;
303 UFUNCTION(BlueprintCallable, BlueprintPure)
304 bool GetStartWindowInitiallyMinimized()
const;
309 UFUNCTION(BlueprintCallable)
310 void SetStartWindowInitiallyMinimized(
bool Minimized);
315 UFUNCTION(BlueprintCallable)
316 void SetRenderCustomDepthPass(
bool RenderCustomDepthPass);
321 UFUNCTION(BlueprintCallable)
322 void SetUseVirtualShadowMaps(
bool UseVirtualShadowMaps);
327 UFUNCTION(BlueprintCallable)
328 bool GetIsUsingVirtualShadowMaps()
const;
333 UFUNCTION(BlueprintCallable)
334 bool GetIsRenderingCustomDepthPass()
const;
339 UFUNCTION(BlueprintCallable)
340 int32 GetNumberOfWorkerThreads()
const;
346 UFUNCTION(BlueprintCallable)
347 FString GetConsoleVariableValueString(
const FString& VariableName)
const;
353 UFUNCTION(BlueprintPure)
356 return GraphicsSettings.QualityLevel;
363 UFUNCTION(BlueprintCallable)
364 TArray<FString> GetMapNames()
const
373 UFUNCTION(BlueprintCallable)
374 TArray<FString> GetMapPaths()
const
383 UPROPERTY(BlueprintAssignable)
384 FGraphicsSettingsDelegate OnGraphicsSettingsChanged;
390 static
bool ShouldStartWindowMinimized()
392 return GetAgrarsenseSettings()->SimulationSettings.StartCameraWindowsMinimized;
407 UFUNCTION(BlueprintPure)
410 return GetAgrarsenseSettings()->SimulationSettings;
416 UFUNCTION(BlueprintPure)
417 static
bool IsSimulationPaused()
425 UFUNCTION(BlueprintPure)
428 return GetAgrarsenseSettings()->GraphicsSettings;
431 UFUNCTION(BlueprintPure)
432 bool IsRaytracingSupported()
const;
447 bool ParseLaunchArguments();
450 void OnSensorSpawned(
ASensor* SensorPtr);
453 void OnSensorDestroyed(
ASensor* SensorPtr);
455 void SetUltraWithRaytracingLevel();
457 void EnableRaytracing();
459 void DisableRaytracing();
461 void SetUltraQualityLevel();
463 void SetBalancedQualityLevel();
465 void SetLowQualityLevel();
467 int NumberOfPostProcessingSensors = 0;
469 bool RenderCustomDepth = false;
472 TWeakObjectPtr<UWorld> CurrentWorld =
nullptr;
481 FDelegateHandle AdvanceFramesHandle;
482 int32 FrameCount = 0;
485 FDelegateHandle EndOfFrameHandle;
493 const TArray<FString> MapNames =
503 const TArray<FString> MapPaths =
505 "/Game/Agrarsense/Maps/MainMenu",
506 "/Game/Agrarsense/Maps/RovaniemiForest/RovaniemiForest",
507 "/Game/Agrarsense/Maps/Vindeln/Vindeln",
508 "/Game/Agrarsense/Maps/SensorShowCase/SensorShowCase",
509 "/Game/Agrarsense/Maps/Playground"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FGraphicsSettingsDelegate, FGlobalGraphicsSettings, GraphicsSettings)
static FString CurrentMapName
static bool IsPlayingInMainMenu()