Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UKismetMathLibrary
Description
Geometry Finds the minimum area rectangle that encloses a set of coplanar points. Uses the exhaustive search algorithm in http://www.geometrictools.com/Documentation/MinimumAreaRectangle.pdf
| Name | MinAreaRectangle |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/Kismet/KismetMathLibrary.h |
| Include Path | #include "Kismet/KismetMathLibrary.h" |
| Source | /Engine/Source/Runtime/Engine/Private/KismetMathLibrary.cpp |
UFUNCTION (BlueprintCallable, Category="Math|Geometry",
Meta=(WorldContext="WorldContextObject", CallableWithoutWorldContext))
static void MinAreaRectangle
(
UObject * WorldContextObject,
const TArray < FVector > & InPoints,
const FVector & SampleSurfaceNormal,
FVector & OutRectCenter,
FRotator & OutRectRotation,
float & OutRectLengthX,
float & OutRectLengthY,
bool bDebugDraw
)
Parameters
| Name | Remarks |
|---|---|
| WorldContextObject | Pointer to world context; only used when debug draw is enabled |
| InPoints | Points to enclose in the rectangle; need to be within the same plane for correct results |
| SampleSurfaceNormal | Normal indicating the surface direction for the points |
| OutRectCenter | Translation for the output rectangle from the origin |
| OutRectRotation | Rotation for the output rectangle from the XY plane |
| OutRectLengthX | Length of the output rectangle along the X axis before rotation |
| OutRectLengthY | Length of the output rectangle along the Y axis before rotation |
| bDebugDraw | Draws the output rectangle for debugging purposes provided the world context is set as well |