Orrery Terrain · OrreryTerrain module · member function
FOrreryTerrainFeatures::
SamplePolygonFromSpline
A closed spline's outline as plate Polygon vertices: samples at equal distances along the loop, Spacing_cm apart at most, the spacing widened so the outline keeps to the terrain's 2048 plate vertices.
Declaration
static bool SamplePolygonFromSpline(const USplineComponent* Spline, double Spacing_cm, TArray<FVector2D>& OutPolygon, FString* OutReason = nullptr);- Header
#include "OrreryTerrainFeatures.h"- Module
PublicDependencyModuleNames.Add("OrreryTerrain");in your module’s Build.cs.- Stability
- Stable: changes within a major version only add.
- Thread
- Game thread (reads the component).
Description
The outline is turned counter-clockwise with the first vertex (the spline's start) kept, as the Plate tool does.
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
Spline | const USpline | — | May be null (refused). |
Spacing_cm | double | — | At least kMinStationSpacing_cm. |
OutPolygon | TArray< | — | Receives the vertices, world XY in cm; emptied first, and left empty on a refusal. |
OutReason | FString* | nullptr | Why false was returned. |
Returns
false for no spline, an open spline, fewer than three distinct vertices, or an outline that crosses itself.
Note.
Game thread (reads the component).