UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FPoly Class Reference

#include <Polys.h>

Public Types

typedef TArray< FVector3f, TInlineAllocator< 16 > > VerticesArrayType
 

Public Member Functions

ENGINE_API FPoly ()
 
ENGINE_API void Init ()
 
ENGINE_API void Reverse ()
 
ENGINE_API void Transform (const FVector3f &PostAdd)
 
ENGINE_API void Rotate (const FRotator3f &Rotation)
 
ENGINE_API void Scale (const FVector3f &Scale)
 
ENGINE_API int32 Fix ()
 
ENGINE_API int32 CalcNormal (bool bSilent=0)
 
ENGINE_API int32 SplitWithPlane (const FVector3f &InBase, const FVector3f &InNormal, FPoly *FrontPoly, FPoly *BackPoly, int32 VeryPrecise) const
 
ENGINE_API int32 SplitWithNode (const UModel *Model, int32 iNode, FPoly *FrontPoly, FPoly *BackPoly, int32 VeryPrecise) const
 
ENGINE_API int32 SplitWithPlaneFast (const FPlane &Plane, FPoly *FrontPoly, FPoly *BackPoly) const
 
ENGINE_API int32 Split (const FVector3f &InNormal, const FVector3f &InBase)
 
ENGINE_API int32 RemoveColinears ()
 
int32 Faces (const FPoly &Test) const
 
ENGINE_API float Area ()
 
bool DoesLineIntersect (FVector Start, FVector End, FVector *Intersect=NULL)
 
bool OnPoly (FVector InVtx)
 
ENGINE_API bool OnPlane (FVector InVtx)
 
ENGINE_API void InsertVertex (int32 InPos, FVector InVtx)
 
ENGINE_API void RemoveVertex (FVector InVtx)
 
ENGINE_API bool IsCoplanar ()
 
ENGINE_API bool IsConvex ()
 
ENGINE_API int32 Triangulate (ABrush *InOwnerBrush, TArray< FPoly > &OutTriangles)
 
ENGINE_API int32 GetVertexIndex (FVector3f &InVtx)
 
ENGINE_API FVector GetMidPoint ()
 
int32 IsBackfaced (const FVector3f &Point) const
 
int32 IsCoplanar (const FPoly &Test) const
 

Static Public Member Functions

static ENGINE_API FPoly BuildInfiniteFPoly (const FPlane &InPlane)
 

Public Attributes

FVector3f Base
 
FVector3f Normal
 
FVector3f TextureU
 
FVector3f TextureV
 
VerticesArrayType Vertices
 
uint32 PolyFlags
 
TObjectPtr< ABrush > Actor
 
TObjectPtr< UMaterialInterfaceMaterial
 
FName RulesetVariation
 
FName ItemName
 
int32 iLink
 
int32 iLinkSurf
 
int32 iBrushPoly
 
uint32 SmoothingMask
 
float LightMapScale
 
FLightmassPrimitiveSettings LightmassSettings
 

Friends

ENGINE_API friend FArchiveoperator<< (FArchive &Ar, FPoly &Poly)
 
bool operator== (const FPoly &A, const FPoly &B)
 
bool operator!= (const FPoly &A, const FPoly &B)
 

Member Typedef Documentation

◆ VerticesArrayType

Constructor & Destructor Documentation

◆ FPoly()

FPoly::FPoly ( )

Constructor, initializing all member variables.

Member Function Documentation

◆ Area()

float FPoly::Area ( )

Computes the 2D area of the polygon. Returns zero if the polygon has less than three verices.

◆ BuildInfiniteFPoly()

FPoly FPoly::BuildInfiniteFPoly ( const FPlane InPlane)
static

Builds a huge poly aligned with the specified plane. This poly is carved up by the calling routine and used as a capping poly following a clip operation.

Parameters
InPlaneThe plane to lay the polygon on.
InCutPlanesThe planes to split the poly with.
InOwnerBrushThe brush that owns the polygons.
Returns
The resulting polygon

◆ CalcNormal()

int32 FPoly::CalcNormal ( bool  bSilent = 0)

Compute normal of an FPoly. Works even if FPoly has 180-degree-angled sides (which are often created during T-joint elimination). Returns nonzero result (plus sets normal vector to zero) if a problem occurs.

◆ DoesLineIntersect()

bool FPoly::DoesLineIntersect ( FVector  Start,
FVector  End,
FVector Intersect = NULL 
)

Checks to see if the specified line intersects this poly or not. If "Intersect" is a valid pointer, it is filled in with the intersection point.

◆ Faces()

int32 FPoly::Faces ( const FPoly Test) const

Return whether this poly and Test are facing each other. The polys are facing if they are noncoplanar, one or more of Test's points is in front of this poly, and one or more of this poly's points are behind Test.

◆ Fix()

int32 FPoly::Fix ( )

Fix up an editor poly by deleting vertices that are identical. Sets vertex count to zero if it collapses. Returns number of vertices, 0 or >=3.

◆ GetMidPoint()

FVector FPoly::GetMidPoint ( )

Computes the mid point of the polygon (in local space).

◆ GetVertexIndex()

int32 FPoly::GetVertexIndex ( FVector3f InVtx)

Finds the index of the specific vertex.

Parameters
InVtxThe vertex to find the index of
Returns
The index of the vertex, if found. Otherwise INDEX_NONE.

◆ Init()

void FPoly::Init ( )

Initialize everything in an editor polygon structure to defaults. Changes to these default values should also be mirrored to UPolysExporterT3D::ExportText(...).

◆ InsertVertex()

void FPoly::InsertVertex ( int32  InPos,
FVector  InVtx 
)

Inserts a vertex into the poly at a specific position.

◆ IsBackfaced()

int32 FPoly::IsBackfaced ( const FVector3f Point) const
inline

◆ IsConvex()

bool FPoly::IsConvex ( )

Checks to see if this polygon is a convex shape.

Returns
true if this polygon is convex.

◆ IsCoplanar() [1/2]

bool FPoly::IsCoplanar ( )

Checks to see if all the vertices on a polygon are coplanar.

◆ IsCoplanar() [2/2]

int32 FPoly::IsCoplanar ( const FPoly Test) const
inline

◆ OnPlane()

bool FPoly::OnPlane ( FVector  InVtx)

Checks to see if the specified vertex lies on this polygons plane.

◆ OnPoly()

bool FPoly::OnPoly ( FVector  InVtx)

Checks to see if the specified vertex is on this poly. Assumes the vertex is on the same plane as the poly and that the poly is convex.

This can be combined with FMath::LinePlaneIntersection to perform a line-fpoly intersection test.

◆ RemoveColinears()

int32 FPoly::RemoveColinears ( )

Remove colinear vertices and check convexity. Returns 1 if convex, 0 if nonconvex or collapsed.

◆ RemoveVertex()

void FPoly::RemoveVertex ( FVector  InVtx)

Removes a vertex from the polygons list of vertices

◆ Reverse()

void FPoly::Reverse ( )

Reverse an FPoly by reversing the normal and reversing the order of its vertices.

◆ Rotate()

void FPoly::Rotate ( const FRotator3f Rotation)

Rotate an editor polygon.

◆ Scale()

void FPoly::Scale ( const FVector3f Scale)

Scale an editor polygon.

◆ Split()

int32 FPoly::Split ( const FVector3f InNormal,
const FVector3f InBase 
)

Split a poly and keep only the front half. Returns number of vertices, 0 if clipped away.

◆ SplitWithNode()

int32 FPoly::SplitWithNode ( const UModel Model,
int32  iNode,
FPoly FrontPoly,
FPoly BackPoly,
int32  VeryPrecise 
) const

Split with a Bsp node.

◆ SplitWithPlane()

int32 FPoly::SplitWithPlane ( const FVector3f InBase,
const FVector3f InNormal,
FPoly FrontPoly,
FPoly BackPoly,
int32  VeryPrecise 
) const

Split with plane. Meant to be numerically stable.

◆ SplitWithPlaneFast()

int32 FPoly::SplitWithPlaneFast ( const FPlane Plane,
FPoly FrontPoly,
FPoly BackPoly 
) const

Split with plane quickly for in-game geometry operations. Results are always valid. May return sliver polys.

◆ Transform()

void FPoly::Transform ( const FVector3f PostAdd)

Transform an editor polygon with a post-transformation addition.

◆ Triangulate()

int32 FPoly::Triangulate ( ABrush *  InOwnerBrush,
TArray< FPoly > &  OutTriangles 
)

Breaks down this polygon into triangles. The triangles are then returned to the caller in an array.

Parameters
InOwnerBrushThe brush that owns this polygon.
OutTrianglesAn array to store the resulting triangles in.
Returns
The number of triangles created

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const FPoly A,
const FPoly B 
)
friend

◆ operator<<

ENGINE_API friend FArchive & operator<< ( FArchive Ar,
FPoly Poly 
)
friend

◆ operator==

bool operator== ( const FPoly A,
const FPoly B 
)
friend

Member Data Documentation

◆ Actor

TObjectPtr<ABrush> FPoly::Actor

◆ Base

FVector3f FPoly::Base

◆ iBrushPoly

int32 FPoly::iBrushPoly

◆ iLink

int32 FPoly::iLink

◆ iLinkSurf

int32 FPoly::iLinkSurf

◆ ItemName

FName FPoly::ItemName

◆ LightMapScale

float FPoly::LightMapScale

◆ LightmassSettings

FLightmassPrimitiveSettings FPoly::LightmassSettings

◆ Material

TObjectPtr<UMaterialInterface> FPoly::Material

◆ Normal

FVector3f FPoly::Normal

◆ PolyFlags

uint32 FPoly::PolyFlags

◆ RulesetVariation

FName FPoly::RulesetVariation

◆ SmoothingMask

uint32 FPoly::SmoothingMask

◆ TextureU

FVector3f FPoly::TextureU

◆ TextureV

FVector3f FPoly::TextureV

◆ Vertices

VerticesArrayType FPoly::Vertices

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