5 #include "CoreMinimal.h" 6 #include "Kismet/BlueprintFunctionLibrary.h" 8 #include "RuntimeMeshSlicer.generated.h" 42 static int32 CompareBoxPlane(
const FBox& InBox,
const FPlane& InPlane);
50 static void Transform2DPolygonTo3D(
const FUtilPoly2D& InPoly,
const FMatrix& InMatrix, TSharedPtr<FRuntimeMeshAccessor> OutMesh);
53 static bool TriangulatePoly(TSharedPtr<FRuntimeMeshAccessor> Mesh, int32 VertBase,
const FVector& PolyNormal);
56 static void SliceConvexElem(
const FKConvexElem& InConvex,
const FPlane& SlicePlane, TArray<FVector>& OutConvexVerts);
59 static void SliceRuntimeMeshConvexCollision(
URuntimeMesh* InRuntimeMesh,
URuntimeMesh* OutOtherHalf, FVector PlanePosition, FVector PlaneNormal);
62 static void SliceRuntimeMeshSection(
const FRuntimeMeshDataPtr& InRuntimeMesh,
const FRuntimeMeshDataPtr& OutOtherHalf, int32 SectionIndex,
const FPlane& SlicePlane, TArray<FUtilEdge3D>& ClipEdges);
70 UFUNCTION(BlueprintCallable, Category =
"Components|RuntimeMesh")
73 UFUNCTION(BlueprintCallable, Category =
"Components|RuntimeMesh")
74 static void SliceRuntimeMeshComponent(URuntimeMeshComponent* InRuntimeMesh, FVector PlanePosition, FVector PlaneNormal,
bool bCreateOtherHalf, URuntimeMeshComponent*& OutOtherHalf,
ERuntimeMeshSlicerCapOption CapOption, UMaterialInterface* CapMaterial);
ERuntimeMeshSlicerCapOption
TSharedPtr< FRuntimeMeshData, ESPMode::ThreadSafe > FRuntimeMeshDataPtr