From c5276971cafc57081db9efdeed97550c9b4067a1 Mon Sep 17 00:00:00 2001 From: Juan Belon Date: Sun, 17 Mar 2024 17:11:37 +0100 Subject: [PATCH] [#281] Minor corrections for Blueprints and comments --- .../RealtimeMeshHeightFieldAnimatedActor.cpp | 1 + .../Public/RealtimeMeshBranchingLinesActor.h | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Source/RealtimeMeshExamples/Private/RealtimeMeshHeightFieldAnimatedActor.cpp b/Source/RealtimeMeshExamples/Private/RealtimeMeshHeightFieldAnimatedActor.cpp index 0233e89..83aa304 100644 --- a/Source/RealtimeMeshExamples/Private/RealtimeMeshHeightFieldAnimatedActor.cpp +++ b/Source/RealtimeMeshExamples/Private/RealtimeMeshHeightFieldAnimatedActor.cpp @@ -22,6 +22,7 @@ void ARealtimeMeshHeightFieldAnimatedActor::OnGenerateMesh_Implementation() // For this example we'll use a helper class to build the mesh data // You can make your own helpers or skip them and use individual TRealtimeMeshStreamBuilder, // or skip them entirely and copy data directly into the streams + // TODO: save this in the class so we can reuse the builder and just modify points when possible TRealtimeMeshBuilderLocal Builder(StreamSet); // here we go ahead and enable all the basic mesh data parts diff --git a/Source/RealtimeMeshExamples/Public/RealtimeMeshBranchingLinesActor.h b/Source/RealtimeMeshExamples/Public/RealtimeMeshBranchingLinesActor.h index c3262c9..0d27b86 100644 --- a/Source/RealtimeMeshExamples/Public/RealtimeMeshBranchingLinesActor.h +++ b/Source/RealtimeMeshExamples/Public/RealtimeMeshBranchingLinesActor.h @@ -7,19 +7,19 @@ #include "Mesh/RealtimeMeshBuilder.h" #include "RealtimeMeshBranchingLinesActor.generated.h" -// A simple struct to keep some data together -USTRUCT() -struct FRealtimeMeshBranchSegment +// A simple struct to keep realtime mesh branch segment data together +USTRUCT(BlueprintType) +struct REALTIMEMESHEXAMPLES_API FRealtimeMeshBranchSegment { GENERATED_BODY() - UPROPERTY() + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Procedural Parameters") FVector Start = FVector::ZeroVector; - UPROPERTY() + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Procedural Parameters") FVector End = FVector::ZeroVector; - UPROPERTY() + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Procedural Parameters") float Width = 0.f; UPROPERTY() @@ -121,6 +121,9 @@ class REALTIMEMESHEXAMPLES_API ARealtimeMeshBranchingLinesActor : public ARealti UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Procedural Parameters") TObjectPtr Material = nullptr; + // Setup random offset directions + UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, EditFixedSize, Category = "Procedural Parameters", meta = (ToolTip = "Minimum : 2 dimensions")) + TArray OffsetDirections = {FVector(1., 0., 0.), FVector(0., 0., 1.)}; private: void GenerateMesh(RealtimeMesh::TRealtimeMeshBuilderLocal& Builder); void CreateSegments(); @@ -136,6 +139,4 @@ class REALTIMEMESHEXAMPLES_API ARealtimeMeshBranchingLinesActor : public ARealti int32 LastCachedCrossSectionCount = 0; TArray CachedCrossSectionPoints; FRandomStream RngStream; - // Setup random offset directions - const TArray OffsetDirections = {FVector(1, 0, 0), FVector(0, 0, 1)}; };