Skip to main content

Rectangle

Base:
UBlueprintFunctionLibrary
Type:
UNRectanglePickerLibrary / FNRectanglePicker
Header File:
NexusActorPools/Public/NRectanglePickerLibrary.h

Rectangle: Next Density

Provides various functions for generating points the plane of a rectangle using different random generation strategies (deterministic, non-deterministic, seeded).

The UNRectanglePickerLibrary wraps the native FNRectanglePicker functionality in a Blueprint friendly manner. Should you be wanting to utilize a picker in native code it is best to directly reference FNRectanglePicker directly to avoid the abstraction layer as it has a similar API.

Methods​

Next Point​

Rectangle: Next Rectangle: Next Projected

Generates a deterministic point inside or on the boundary of a rectangle.

info

Uses FNRandom::Deterministic to ensure reproducible results.

Random Point​

Rectangle: Random Rectangle: Random Projected

Generates a random point inside or on the boundary of a rectangle.

info

Uses FNRandom::NonDeterministic to produce pseudo-random results.

One-Shot Point​

Rectangle: One-Shot Rectangle: One-Shot Projected

Generates a random point inside or on the boundary of a rectangle using a provided seed.

Tracked Point​

Rectangle: Tracked Rectangle: Tracked Projected

Generates a random point inside or on the boundary of a rectangle using a tracked seed.

FNRectanglePickerParams​

warning

It is important to be aware of the performance penalty when using MinimumDimensions. It is only included for special use cases where absolutely necessary. It can also create biased results when selecting points as it has to create a series of ranges first which can be used; their shapes and sizes are directly related to the inner dimensions.

Base​

ParameterTypeDescriptionDefault
CountintThe number of points to generate in a single pass.1
CachedWorldTObjectPtr<UWorld>The world for line tracing and drawing.
ProjectionModeENPickerProjectionModeShould the point be projected somewhere?ENPickerProjectionMode::None
ProjectionFVectorDirection and distance for the line trace.FVector(0,0,-500.f)
CollisionChannelTEnumAsByte<ECollisionChannel>The collision channel to use for tracing.ECC_WorldStatic

Box​

ParameterTypeDescriptionDefault
OriginFVectorThe center point when attempting to generate new points.FVector::ZeroVector
MinimumDimensionsFVector2DThe inner dimensions of the rectangle (X = width, Y = height).FVector2D::ZeroVector
MaximumDimensionsFVector2DThe outer dimensions of the rectangle (X = width, Y = height).FVector2D(1.f,1.f)
RotationFRotatorThe rotation of the rectangle plane.FRotator::ZeroRotator