11#include <util/ue-header-guard-begin.h>
12#include "CoreMinimal.h"
13#include "Kismet/BlueprintFunctionLibrary.h"
14#include "MeshDescription.h"
15#include "ProceduralMeshComponent.h"
16#include <util/ue-header-guard-end.h>
18#include "MapGenFunctionLibrary.generated.h"
28 UFUNCTION(BlueprintCallable)
31 const TArray<FProcMeshTangent>& ParamTangents,
32 UMaterialInstance* MaterialInstance,
39 const TArray<FProcMeshTangent>& ParamTangents,
40 UMaterialInstance* MaterialInstance );
42 UFUNCTION(BlueprintCallable)
45 UFUNCTION(BlueprintCallable)
48 UFUNCTION(BlueprintCallable)
51 UFUNCTION(BlueprintCallable)
56 UFUNCTION(BlueprintCallable)
60 UFUNCTION(BlueprintCallable)
65 UFUNCTION(BlueprintCallable)
68 UFUNCTION(BlueprintCallable)
72 UFUNCTION(BlueprintCallable)
75 UFUNCTION(BlueprintCallable)
78 UFUNCTION(BlueprintCallable)
80 TArray<FVector>& Vertices,
81 const TArray<int32>& Indices,
83 int NumIterations = 1,
84 float SmoothingFactor = 1.0f
87 static uint16
GetPixelG16(
const TArrayView64<const uint16>& Pixels,
int Width,
int Height,
int X,
int Y)
89 X = FMath::Clamp(X, 0, Width - 1);
90 Y = FMath::Clamp(Y, 0, Height - 1);
91 return Pixels[Y * Width + X];
94 static float CubicHermite(
float A,
float B,
float C,
float D,
float T)
96 float a = -0.5f*A + 1.5f*B - 1.5f*C + 0.5f*D;
97 float b = A - 2.5f*B + 2.0f*C - 0.5f*D;
98 float c = -0.5f*A + 0.5f*C;
100 return ((a * T + b) * T + c) * T + d;
103 static float BicubicSampleG16(
const TArrayView64<const uint16>& Pixels,
int Width,
int Height,
float X,
float Y);
DECLARE_LOG_CATEGORY_EXTERN(LogCarlaMapGenFunctionLibrary, Log, All)
static TArray< class AInstancedStaticMeshActor * > ChangeStaticMeshesInTheLevelForInstancedStaticMeshes(UWorld *World, TArray< UStaticMesh * > Filter, int MinNumOfInstancesToBeChanged=20)
static void CleanupGEngine()
static void FlushRenderingCommandsInBlueprint()
static float CubicHermite(float A, float B, float C, float D, float T)
static uint16 GetPixelG16(const TArrayView64< const uint16 > &Pixels, int Width, int Height, int X, int Y)
static TArray< AStaticMeshActor * > RevertStaticMeshesInTheLevelForInstancedStaticMeshes(UWorld *World, TArray< UStaticMesh * > Filter)
static UStaticMesh * CreateMesh(const FProceduralCustomMesh &Data, const TArray< FProcMeshTangent > &ParamTangents, UMaterialInstance *MaterialInstance, FString MapName, FString FolderName, FName MeshName)
static UInstancedStaticMeshComponent * AddInstancedStaticMeshComponentToActor(AActor *TargetActor)
static void SetThreadToSleep(float seconds)
static FMeshDescription BuildMeshDescriptionFromData(const FProceduralCustomMesh &Data, const TArray< FProcMeshTangent > &ParamTangents, UMaterialInstance *MaterialInstance)
static FVector2D GetTransversemercProjection(float lat, float lon, float lat0, float lon0)
static FVector2D InverseTransverseMercatorProjection(float x, float y, float lat0, float lon0)
static UStaticMeshComponent * AddStaticMeshComponentToActor(AActor *TargetActor)
static USceneComponent * AddSceneComponentToActor(AActor *TargetActor)
static void SmoothVerticesDeep(TArray< FVector > &Vertices, const TArray< int32 > &Indices, int Depth=3, int NumIterations=1, float SmoothingFactor=1.0f)
A definition of a Carla Mesh.