UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::FStairGenerator Class Referenceabstract

#include <StairGenerator.h>

+ Inheritance diagram for UE::Geometry::FStairGenerator:

Public Types

enum class  ESide {
  Right , Left , Front , Top ,
  Back , Bottom
}
 

Public Member Functions

virtual GEOMETRYCORE_API ~FStairGenerator () override
 
virtual GEOMETRYCORE_API FMeshShapeGeneratorGenerate () override
 
- Public Member Functions inherited from UE::Geometry::FMeshShapeGenerator
virtual ~FMeshShapeGenerator ()
 
bool HasAttributes () const
 
void ResetAttributes (bool bResetPolygonIDs=false)
 
void Reset ()
 
void SetBufferSizes (int NumVertices, int NumTriangles, int NumUVs, int NumNormals)
 
void ExtendBufferSizes (int AddVertices, int AddTriangles, int AddUVs, int AddNormals)
 
void SetVertex (int Index, const FVector3d &Position)
 
int AppendVertex (const FVector3d &Position)
 
void SetUV (int Index, const FVector2f &UV, int ParentVertex)
 
int AppendUV (const FVector2f &UV, int ParentVertex)
 
void SetNormal (int Index, const FVector3f &Normal, int ParentVertex)
 
int AppendNormal (const FVector3f &Normal, int ParentVertex)
 
void SetTriangle (int Index, const FIndex3i &Tri)
 
void SetTriangle (int Index, int A, int B, int C)
 
void SetTriangle (int Index, int A, int B, int C, bool bClockwiseOverride)
 
int AppendTriangle (int A, int B, int C)
 
void SetTriangleUVs (int Index, const FIndex3i &Tri)
 
void SetTriangleUVs (int Index, int A, int B, int C)
 
void SetTriangleUVs (int Index, int A, int B, int C, bool bClockwiseOverride)
 
void SetTriangleNormals (int Index, const FIndex3i &Tri)
 
void SetTriangleNormals (int Index, int A, int B, int C)
 
void SetTriangleNormals (int Index, int A, int B, int C, bool bClockwiseOverride)
 
void SetTrianglePolygon (int Index, int PolygonID)
 
void SetTriangleWithMatchedUVNormal (int Index, int A, int B, int C)
 

Public Attributes

bool bScaleUVByAspectRatio = true
 
bool bPolygroupPerQuad = false
 
float StepWidth = 150.0f
 
float StepHeight = 20.0f
 
int NumSteps = 8
 
- Public Attributes inherited from UE::Geometry::FMeshShapeGenerator
TArray< FVector3dVertices
 
TArray< FVector2fUVs
 
TArray< int > UVParentVertex
 
TArray< FVector3fNormals
 
TArray< int > NormalParentVertex
 
TArray< FIndex3iTriangles
 
TArray< FIndex3iTriangleUVs
 
TArray< FIndex3iTriangleNormals
 
TArray< int > TrianglePolygonIDs
 
bool bReverseOrientation = false
 

Protected Types

enum class  EStairStyle { Solid , Floating }
 

Protected Member Functions

virtual GEOMETRYCORE_API void ResetData ()
 
virtual FVector3d GenerateVertex (ESide Side, int VertexColumn, int VertexRow)=0
 
virtual FVector3f GenerateNormal (ESide Side, int VertexId)=0
 
virtual FVector2f GenerateUV (ESide Side, int Step, int VertexId, float UVScale)=0
 
virtual float GetMaxDimension ()=0
 

Protected Attributes

EStairStyle StairStyle = EStairStyle::Solid
 
TArray< TArray< int > > VertexIds
 
TArray< FIndex2iVertexIdsToColumnRow
 
TArray< int > FaceDesc
 
TArray< int > NormalDesc
 
TArray< int > UVDesc
 
int NumQuadsPerSide = 0
 
int NumQuads = 0
 
int NumVertsPerSide = 0
 
int NumVerts = 0
 
int NumAttrs = 0
 
int RightSideColumnId = 0
 
int LeftSideColumnId = 0
 
int RightStartFaceId = 0
 
int LeftStartFaceId = 0
 
int FrontStartFaceId = 0
 
int TopStartFaceId = 0
 
int BackStartFaceId = 0
 
int BottomStartFaceId = 0
 
int LastFaceId = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from UE::Geometry::FMeshShapeGenerator
static FVector3d BilinearInterp (const FVector3d &v00, const FVector3d &v10, const FVector3d &v11, const FVector3d &v01, double tx, double ty)
 
static FVector2d BilinearInterp (const FVector2d &v00, const FVector2d &v10, const FVector2d &v11, const FVector2d &v01, double tx, double ty)
 
static FVector2f BilinearInterp (const FVector2f &v00, const FVector2f &v10, const FVector2f &v11, const FVector2f &v01, float tx, float ty)
 
static FVector3i LinearInterp (const FVector3i &a, const FVector3i &b, double t)
 

Detailed Description

Base Stair mesh generator class.

Member Enumeration Documentation

◆ ESide

Enumerator
Right 
Left 
Front 
Top 
Back 
Bottom 

◆ EStairStyle

Enumerator
Solid 
Floating 

Constructor & Destructor Documentation

◆ ~FStairGenerator()

FStairGenerator::~FStairGenerator ( )
overridevirtualdefault

Member Function Documentation

◆ Generate()

FMeshShapeGenerator & FStairGenerator::Generate ( )
overridevirtual

Generate the mesh

Implements UE::Geometry::FMeshShapeGenerator.

◆ GenerateNormal()

virtual FVector3f UE::Geometry::FStairGenerator::GenerateNormal ( ESide  Side,
int  VertexId 
)
protectedpure virtual

Returns a vertex normal vector.

All normals for a given side are shared except for Front & Top. Border vertex normals per side are not shared.

Parameters
SideThe side of the stairs to compute the normal.
VertexIdThe vertex index to compute the normal.

Implemented in UE::Geometry::FLinearStairGenerator, and UE::Geometry::FCurvedStairGenerator.

◆ GenerateUV()

virtual FVector2f UE::Geometry::FStairGenerator::GenerateUV ( ESide  Side,
int  Step,
int  VertexId,
float  UVScale 
)
protectedpure virtual

Returns a UV vector.

The Step parameter provides the Side-relative face. This indicates which face for a given side is computing its UV.

All UVs for a given side are shared except for Front & Top. Border edges along each side are UV island edges.

Parameters
SideThe side of the stairs to compute the UV.
StepThe Side-relative step face ID.
VertexIdThe vertex index to compute the UV.
UVScaleThe UV scale

Implemented in UE::Geometry::FLinearStairGenerator, UE::Geometry::FFloatingStairGenerator, UE::Geometry::FCurvedStairGenerator, and UE::Geometry::FSpiralStairGenerator.

◆ GenerateVertex()

virtual FVector3d UE::Geometry::FStairGenerator::GenerateVertex ( ESide  Side,
int  VertexColumn,
int  VertexRow 
)
protectedpure virtual

Returns a vertex position.

The method is provided the Right or Left side and the corresponding vertex column/row index to compute. Column and row indices refer to the matrix-like ordered vertex layout. See diagram in GenerateSolidStairs() / GenerateFloatingStairs().

This generator only generates vertices for the Right & Left Sides of the stairs.

Mesh count protected variables are the only transient variables guaranteed to be valid at the time GenerateVertex is invoked.

Parameters
SideThe Right or Left side of the stairs.
VertexColumnThe column index into the stair vertex layout.
VertexRowThe row index into the stair vertex layout.

Implemented in UE::Geometry::FLinearStairGenerator, UE::Geometry::FFloatingStairGenerator, UE::Geometry::FCurvedStairGenerator, and UE::Geometry::FSpiralStairGenerator.

◆ GetMaxDimension()

virtual float UE::Geometry::FStairGenerator::GetMaxDimension ( )
protectedpure virtual

Returns the max dimension of the staircase for the purposes of computing the world UV scale.

Implemented in UE::Geometry::FLinearStairGenerator, and UE::Geometry::FCurvedStairGenerator.

◆ ResetData()

void FStairGenerator::ResetData ( )
protectedvirtual

Reset state data on the generator

Reset state data on the generator.

This is invoked at the head of the Generate() method.

Reimplemented in UE::Geometry::FCurvedStairGenerator.

Member Data Documentation

◆ BackStartFaceId

int UE::Geometry::FStairGenerator::BackStartFaceId = 0
protected

◆ BottomStartFaceId

int UE::Geometry::FStairGenerator::BottomStartFaceId = 0
protected

◆ bPolygroupPerQuad

bool UE::Geometry::FStairGenerator::bPolygroupPerQuad = false

If true, each quad of box gets a separate polygroup

◆ bScaleUVByAspectRatio

bool UE::Geometry::FStairGenerator::bScaleUVByAspectRatio = true

If true (default), UVs are scaled so that there is no stretching. If false, UVs are scaled to fill unit square

◆ FaceDesc

TArray<int> UE::Geometry::FStairGenerator::FaceDesc
protected

◆ FrontStartFaceId

int UE::Geometry::FStairGenerator::FrontStartFaceId = 0
protected

◆ LastFaceId

int UE::Geometry::FStairGenerator::LastFaceId = 0
protected

◆ LeftSideColumnId

int UE::Geometry::FStairGenerator::LeftSideColumnId = 0
protected

◆ LeftStartFaceId

int UE::Geometry::FStairGenerator::LeftStartFaceId = 0
protected

◆ NormalDesc

TArray<int> UE::Geometry::FStairGenerator::NormalDesc
protected

◆ NumAttrs

int UE::Geometry::FStairGenerator::NumAttrs = 0
protected

◆ NumQuads

int UE::Geometry::FStairGenerator::NumQuads = 0
protected

◆ NumQuadsPerSide

int UE::Geometry::FStairGenerator::NumQuadsPerSide = 0
protected

Mesh counts.

◆ NumSteps

int UE::Geometry::FStairGenerator::NumSteps = 8

The number of steps in this staircase.

◆ NumVerts

int UE::Geometry::FStairGenerator::NumVerts = 0
protected

◆ NumVertsPerSide

int UE::Geometry::FStairGenerator::NumVertsPerSide = 0
protected

◆ RightSideColumnId

int UE::Geometry::FStairGenerator::RightSideColumnId = 0
protected

Vertex column indices.

◆ RightStartFaceId

int UE::Geometry::FStairGenerator::RightStartFaceId = 0
protected

Face descriptor indices.

◆ StairStyle

EStairStyle UE::Geometry::FStairGenerator::StairStyle = EStairStyle::Solid
protected

The style of the stairs

◆ StepHeight

float UE::Geometry::FStairGenerator::StepHeight = 20.0f

The height of each step.

◆ StepWidth

float UE::Geometry::FStairGenerator::StepWidth = 150.0f

The width of each step.

◆ TopStartFaceId

int UE::Geometry::FStairGenerator::TopStartFaceId = 0
protected

◆ UVDesc

TArray<int> UE::Geometry::FStairGenerator::UVDesc
protected

◆ VertexIds

TArray<TArray<int> > UE::Geometry::FStairGenerator::VertexIds
protected

◆ VertexIdsToColumnRow

TArray<FIndex2i> UE::Geometry::FStairGenerator::VertexIdsToColumnRow
protected

The documentation for this class was generated from the following files: