Skip to content

Commit

Permalink
[TriAxis-Games#281] Minor corrections for Blueprints and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
juaxix committed Mar 17, 2024
1 parent daed80b commit c527697
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint16, FPackedNormal, FVector2DHalf, 1> Builder(StreamSet);

// here we go ahead and enable all the basic mesh data parts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -121,6 +121,9 @@ class REALTIMEMESHEXAMPLES_API ARealtimeMeshBranchingLinesActor : public ARealti
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Procedural Parameters")
TObjectPtr<UMaterialInterface> Material = nullptr;

// Setup random offset directions
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, EditFixedSize, Category = "Procedural Parameters", meta = (ToolTip = "Minimum : 2 dimensions"))
TArray<FVector> OffsetDirections = {FVector(1., 0., 0.), FVector(0., 0., 1.)};
private:
void GenerateMesh(RealtimeMesh::TRealtimeMeshBuilderLocal<uint16, FPackedNormal, FVector2DHalf, 1>& Builder);
void CreateSegments();
Expand All @@ -136,6 +139,4 @@ class REALTIMEMESHEXAMPLES_API ARealtimeMeshBranchingLinesActor : public ARealti
int32 LastCachedCrossSectionCount = 0;
TArray<FVector> CachedCrossSectionPoints;
FRandomStream RngStream;
// Setup random offset directions
const TArray<FVector> OffsetDirections = {FVector(1, 0, 0), FVector(0, 0, 1)};
};

0 comments on commit c527697

Please sign in to comment.