5 #include "Kismet/GameplayStatics.h" 11 PrimaryActorTick.bCanEverTick =
false;
23 #if WITH_EDITOR // Only for debugging purposes. Requires to activate tick in contructor 24 if((
int)DeltaTime % 2000 == 0)
27 AActor* Car = UGameplayStatics::GetActorOfClass(GetWorld(),
CarClass);
31 FVector CarPos = Car->GetActorLocation();
35 uint64 TileIndex = LargeMapManager->
GetTileID(GlobalCarPos);
39 UE_LOG(LogCarla, Log, TEXT(
"Current Tile Index %d ----> (%d, %d, %d) with position L[%f, %f, %f] G[%f, %f, %f] Terrain Type: %s"),
40 TileIndex, TileVector.X, TileVector.Y, TileVector.Z, CarPos.X, CarPos.Y, CarPos.Z, GlobalCarPos.X, GlobalCarPos.Y, GlobalCarPos.Z,
72 const FString TerrainPropertiesStr = TerrainProperties.
ToString();
73 UE_LOG(LogCarla, Log, TEXT(
"Setting General Terrain Settings %s"), *TerrainPropertiesStr);
82 FIntVector TileVectorID(TileX, TileY, 0);
TileID GetTileID(FVector TileLocation) const
From a given location it retrieves the TileID that covers that area.
TSubclassOf< AActor > CarClass
void AddTerrainPropertiesToTile(int TileX, int TileY, FSoilTerramechanicsProperties TerrainProperties)
TMap< FIntVector, FSoilTerramechanicsProperties > TilesTerrainProperties
FSoilTerramechanicsProperties GetTerrainPropertiesAtGlobalLocation(FVector VehicleLocation)
TEnumAsByte< ESoilTerramechanicsType > TerrainType
void SetGeneralTerrainProperties(FSoilTerramechanicsProperties TerrainProperties)
void ClearTerrainPropertiesMap()
ALargeMapManager * LargeMapManager
const FString ToString() const
virtual void Tick(float DeltaSeconds) override
FSoilTerramechanicsProperties GeneralTerrainProperties
FSoilTerramechanicsProperties GetTerrainPropertiesAtLocalLocation(FVector VehicleLocation)
FSoilTerramechanicsProperties GetGeneralTerrainProperties()
FVector LocalToGlobalLocation(const FVector &InLocation) const
FIntVector GetTileVectorID(FVector TileLocation) const
virtual void BeginPlay() override