RuntimeMeshSlicer.h
Go to the documentation of this file.
1 // Copyright 2016-2018 Chris Conway (Koderz). All Rights Reserved.
2 
3 #pragma once
4 
5 #include "CoreMinimal.h"
6 #include "Kismet/BlueprintFunctionLibrary.h"
7 #include "RuntimeMeshBuilder.h"
8 #include "RuntimeMeshSlicer.generated.h"
9 
10 
11 struct FUtilPoly2D;
12 struct FUtilEdge3D;
13 struct FKConvexElem;
14 
16 UENUM()
17 enum class ERuntimeMeshSlicerCapOption : uint8
18 {
20  NoCap,
25 };
26 
30 UCLASS()
31 class RUNTIMEMESHCOMPONENT_API URuntimeMeshSlicer : public UBlueprintFunctionLibrary
32 {
33  GENERATED_BODY()
34 
35 
36 
42  static int32 CompareBoxPlane(const FBox& InBox, const FPlane& InPlane);
43 
47  static FRuntimeMeshAccessorVertex InterpolateVert(const FRuntimeMeshAccessorVertex& V0, const FRuntimeMeshAccessorVertex& V1, float Alpha);
48 
50  static void Transform2DPolygonTo3D(const FUtilPoly2D& InPoly, const FMatrix& InMatrix, TSharedPtr<FRuntimeMeshAccessor> OutMesh);
51 
53  static bool TriangulatePoly(TSharedPtr<FRuntimeMeshAccessor> Mesh, int32 VertBase, const FVector& PolyNormal);
54 
56  static void SliceConvexElem(const FKConvexElem& InConvex, const FPlane& SlicePlane, TArray<FVector>& OutConvexVerts);
57 
59  static void SliceRuntimeMeshConvexCollision(URuntimeMesh* InRuntimeMesh, URuntimeMesh* OutOtherHalf, FVector PlanePosition, FVector PlaneNormal);
60 
62  static void SliceRuntimeMeshSection(const FRuntimeMeshDataPtr& InRuntimeMesh, const FRuntimeMeshDataPtr& OutOtherHalf, int32 SectionIndex, const FPlane& SlicePlane, TArray<FUtilEdge3D>& ClipEdges);
63 
65  static int32 CapMeshSlice(const FRuntimeMeshDataPtr& InRuntimeMesh, const FRuntimeMeshDataPtr& OutOtherHalf, TArray<FUtilEdge3D>& ClipEdges, const FPlane& SlicePlane, FVector PlaneNormal, ERuntimeMeshSlicerCapOption CapOption);
66 
67 
68 public:
69 
70  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMesh")
71  static void SliceRuntimeMesh(URuntimeMesh* InRuntimeMesh, FVector PlanePosition, FVector PlaneNormal, URuntimeMesh* OutOtherHalf, ERuntimeMeshSlicerCapOption CapOption, UMaterialInterface* CapMaterial);
72 
73  UFUNCTION(BlueprintCallable, Category = "Components|RuntimeMesh")
74  static void SliceRuntimeMeshComponent(URuntimeMeshComponent* InRuntimeMesh, FVector PlanePosition, FVector PlaneNormal, bool bCreateOtherHalf, URuntimeMeshComponent*& OutOtherHalf, ERuntimeMeshSlicerCapOption CapOption, UMaterialInterface* CapMaterial);
75 
76 };
ERuntimeMeshSlicerCapOption
TSharedPtr< FRuntimeMeshData, ESPMode::ThreadSafe > FRuntimeMeshDataPtr


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:41