CARLA
 
载入中...
搜索中...
未找到
SoilTypeManager.h
浏览该文件的文档.
1// Copyright (c) 2017 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
5#include "CoreMinimal.h"
6#include "GameFramework/Actor.h"
8#include "SoilTypeManager.generated.h"
9
10UENUM(BlueprintType)
17
18USTRUCT(BlueprintType)
20{
21 GENERATED_BODY()
22
23 UPROPERTY(EditAnywhere, BlueprintReadWrite)
24 TEnumAsByte<ESoilTerramechanicsType> TerrainType;
25
26 const FString ToString() const
27 {
28 switch(TerrainType)
29 {
31 return "None";
33 return "Desert";
35 return "Forest";
36 }
37 return "";
38 };
39};
40
41UCLASS()
42class CARLA_API ASoilTypeManager : public AActor
43{
44 GENERATED_BODY()
45
46private:
47 UPROPERTY(EditAnywhere)
48 FSoilTerramechanicsProperties GeneralTerrainProperties;
49
50 UPROPERTY(EditAnywhere)
51 TMap<FIntVector, FSoilTerramechanicsProperties> TilesTerrainProperties;
52
53 UPROPERTY(EditAnywhere)
54 ALargeMapManager* LargeMapManager;
55
56public:
57 // Sets default values for this actor's properties
59
60 UPROPERTY(EditAnywhere, BlueprintReadWrite)
61 TSubclassOf<AActor> CarClass;
62
63protected:
64 // Called when the game starts or when spawned
65 virtual void BeginPlay() override;
66
67public:
68 UFUNCTION(Category="MapGen|Soil Manager")
69 FSoilTerramechanicsProperties GetGeneralTerrainProperties();
70
71 UFUNCTION(Category="MapGen|Soil Manager")
72 FSoilTerramechanicsProperties GetTerrainPropertiesAtGlobalLocation(FVector VehicleLocation);
73
74 UFUNCTION(Category="MapGen|Soil Manager")
75 FSoilTerramechanicsProperties GetTerrainPropertiesAtLocalLocation(FVector VehicleLocation);
76
77 UFUNCTION(Category="MapGen|Soil Manager")
78 void SetGeneralTerrainProperties(FSoilTerramechanicsProperties TerrainProperties);
79
80 UFUNCTION(Category="MapGen|Soil Manager")
81 void AddTerrainPropertiesToTile(int TileX, int TileY, FSoilTerramechanicsProperties TerrainProperties);
82
83 UFUNCTION(Category="MapGen|Soil Manager")
84 void ClearTerrainPropertiesMap();
85
86 virtual void Tick(float DeltaSeconds) override;
87
88};
ESoilTerramechanicsType
@ DESERT
@ FOREST
@ NONE_SOIL