PAPER2UPaperTerrainComponent

The terrain visualization component for an associated spline component.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

Paper2D

Header

/Engine/Plugins/2D/Paper2D/Source/Paper2D/Classes/PaperTerrainComponent.h

Include

#include "PaperTerrainComponent.h"

Syntax

UCLASS(BlueprintType, Experimental)
class PAPER2UPaperTerrainComponent : public UPrimitiveComponent

Remarks

The terrain visualization component for an associated spline component. This takes a 2D terrain material and instances sprite geometry along the spline path.

Variables

Name Description

Public variable UProperty

TObjectPtr< cla...

 

AssociatedSpline

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

bool

 

bClosedSpline

Public variable UProperty Category, EditAnywhere, Meta BlueprintReadOnly

bool

 

bFilledSpline

Protected variable UProperty Transient duplicatetransient

TObjectPtr< cla...

 

CachedBodySetup

Description of collision

Protected variable UProperty Category, EditAnywhere

float

 

CollisionThickness

The extrusion thickness of collision geometry when using a 3D collision domain

Protected variable

TArray< FPaperT...

 

GeneratedSpriteGeometry

Public variable UProperty Category, EditAnywhere

int32

 

RandomSeed

Random seed used for choosing which spline meshes to use.

Protected variable UProperty Category, EditAnywhere, AdvancedDisplay, Meta

int32

 

ReparamStepsPerSegment

Number of steps per spline segment to place in the reparameterization table

Public variable UProperty Category, EditAnywhere

float

 

SegmentOverlapAmount

The overlap amount between segments

Protected variable UProperty Category, EditAnywhere

TEnumAsByte< ES...

 

SpriteCollisionDomain

Collision domain (no collision, 2D (experimental), or 3D)

Protected variable UProperty Category, Interp BlueprintReadOnly

FLinearColor

 

TerrainColor

The color of the terrain (passed to the sprite material as a vertex color)

Public variable UProperty Category, EditAnywhere BlueprintReadOnly

TObjectPtr< cla...

 

TerrainMaterial

The terrain material to apply to this component (set of rules for which sprites are used on different surfaces or the interior)

Constructors

Name Description

Public function

PAPER2UPaperTerrainComponent

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Protected function

void

 

ConstrainSplinePointsToXZ()

Protected function

void

 

GenerateCollisionDataFromPolygon

(
    const TArray< FVector2D >& SplineP...,
    const TArray< float >& TerrainOffs...,
    const TArray< FVector2D >& Triangu...
)

Protected function

void

 

GenerateFillRenderDataFromPolygon

(
    const UPaperSprite* NewSprite,
    FSpriteDrawCallRecord& FillDrawCal...,
    const FVector2D& TextureSize,
    const TArray< FVector2D >& Triangu...
)

Protected function Const

FTransform

 

GetTransformAtDistance

(
    float InDistance
)

Protected function

void

 

InsertConvexCollisionDataFromPolygon

(
    const TArray< FVector2D >& ClosedP...
)

Protected function

void

 

OnSplineEdited()

Public function UFunction BlueprintCallable, Category

void

 

SetTerrainColor

(
    FLinearColor NewColor
)

Set color of the terrain.

Protected function

void

 

SpawnSegments

(
    const TArray< FTerrainSegment >& T...,
    bool bGenerateSegmentColliders
)

Overridden from UPrimitiveComponent

Name Description

Public function Virtual

FPrimitiveSc...

 

CreateSceneProxy()

Creates a proxy to represent the primitive to the scene manager in the rendering thread.

Public function Virtual

UBodySetup &...

 

GetBodySetup()

Return the BodySetup to use for this PrimitiveComponent (single body case)

Overridden from USceneComponent

Name Description

Public function Virtual Const

FBoxSphereBo...

 

CalcBounds

(
    const FTransform& LocalToWorld
)

Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size.

Overridden from UActorComponent

Name Description

Public function Virtual Const

const UObjec...

 

AdditionalStatObject()

Give a readable name for this component, including asset name if applicable

Public function Virtual

void

 

OnRegister()

Called when a component is registered, after Scene is set, but before CreateRenderState_Concurrent or OnCreatePhysicsState are called.

Public function Virtual

void

 

OnUnregister()

Called when a component is unregistered.

Overridden from UObject

Name Description

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.