CARLA
Loading...
Searching...
No Matches
SoilTypeManager.h
Go to the documentation of this file.
1// Copyright (c) 2026 Computer Vision Center (CVC) at the Universitat Autonoma de Barcelona (UAB). This work is licensed under the terms of the MIT license. For a copy, see <https://opensource.org/licenses/MIT>.
2
3#pragma once
4
6
7#include <util/ue-header-guard-begin.h>
8#include "CoreMinimal.h"
9#include "GameFramework/Actor.h"
10#include <util/ue-header-guard-end.h>
11
12#include "SoilTypeManager.generated.h"
13
14UENUM(BlueprintType)
21
22USTRUCT(BlueprintType)
24{
25 GENERATED_BODY()
26
27 UPROPERTY(EditAnywhere, BlueprintReadWrite)
29
30 const FString ToString() const
31 {
32 switch(TerrainType)
33 {
35 return "None";
37 return "Desert";
39 return "Forest";
40 }
41 return "";
42 };
43};
44
45UCLASS()
46class CARLA_API ASoilTypeManager : public AActor
47{
48 GENERATED_BODY()
49
50private:
51 UPROPERTY(EditAnywhere)
52 FSoilTerramechanicsProperties GeneralTerrainProperties;
53
54 UPROPERTY(EditAnywhere)
55 TMap<FIntVector, FSoilTerramechanicsProperties> TilesTerrainProperties;
56
57 UPROPERTY(EditAnywhere)
58 ALargeMapManager* LargeMapManager;
59
60public:
61 // Sets default values for this actor's properties
63
64 UPROPERTY(EditAnywhere, BlueprintReadWrite)
65 TSubclassOf<AActor> CarClass;
66
67protected:
68 // Called when the game starts or when spawned
69 virtual void BeginPlay() override;
70
71public:
72 UFUNCTION(Category="MapGen|Soil Manager")
73 FSoilTerramechanicsProperties GetGeneralTerrainProperties();
74
75 UFUNCTION(Category="MapGen|Soil Manager")
76 FSoilTerramechanicsProperties GetTerrainPropertiesAtGlobalLocation(FVector VehicleLocation);
77
78 UFUNCTION(Category="MapGen|Soil Manager")
79 FSoilTerramechanicsProperties GetTerrainPropertiesAtLocalLocation(FVector VehicleLocation);
80
81 UFUNCTION(Category="MapGen|Soil Manager")
82 void SetGeneralTerrainProperties(FSoilTerramechanicsProperties TerrainProperties);
83
84 UFUNCTION(Category="MapGen|Soil Manager")
85 void AddTerrainPropertiesToTile(int TileX, int TileY, FSoilTerramechanicsProperties TerrainProperties);
86
87 UFUNCTION(Category="MapGen|Soil Manager")
88 void ClearTerrainPropertiesMap();
89
90 virtual void Tick(float DeltaSeconds) override;
91
92};
ESoilTerramechanicsType
@ DESERT
@ FOREST
@ NONE_SOIL