UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::FHullConnectivity< RealType > Struct Template Reference

Classes

struct  FNewTriangle
 
struct  FVisiblePoints
 

Public Member Functions

void BuildNeighbors (const TArray< FIndex3i > &Triangles)
 
bool IsVisible (const TVector< RealType > TriPts[3], const TVector< RealType > &Pt)
 
void SetTriPts (const FIndex3i &Tri, TFunctionRef< TVector< RealType >(int32)> GetPointFunc, TVector< RealType > TriPtsOut[3])
 
void InitVisibility (const TArray< FIndex3i > &Triangles, int32 NumPoints, TFunctionRef< TVector< RealType >(int32)> GetPointFunc, TFunctionRef< bool(int32)> FilterFunc)
 
void UpdateNeighbors (int32 TriIdx, int32 NewIdx)
 
void UpdateNeighbor (TArray< FIndex3i > &Triangles, int32 TriIdx, int32 EdgeFirstVertex, int32 NewNbrIdx)
 
bool ValidateConnectivity (TArray< FIndex3i > &Triangles, TSet< int32 > Skip=TSet< int32 >())
 
void DeleteTriangles (TArray< FIndex3i > &Triangles, const TSet< int32 > &ToDelete)
 
FIndex2i ChooseVisiblePoint (bool bChooseBestPoint)
 
void RemoveVisiblePoint (FIndex2i TriPointPair, TFunctionRef< TVector< RealType >(int32)> GetPointFunc)
 
void ClearVisiblePointsData (int32 TriIdx, TArray< int32 > &NewlyUnclaimed)
 
bool HorizonHelper (const TArray< FIndex3i > &Triangles, TFunctionRef< TVector< RealType >(int32)> GetPointFunc, const TVector< RealType > &Pt, TArray< int32 > &NewlyUnclaimed, TSet< int32 > &ToDelete, TArray< FNewTriangle > &ToAdd, int32 TriIdx, int32 CrossedEdgeFirstVertex, bool bCouldSkipPoint=false)
 
bool UpdateHullWithNewPoint (TArray< FIndex3i > &Triangles, int32 NumPoints, TFunctionRef< TVector< RealType >(int32)> GetPointFunc, int32 StartTriIdx, int32 PtIdx, RealType DegenerateEdgeToleranceSq=(RealType) 0)
 

Public Attributes

TArray< FIndex3iTriNeighbors
 
TArray< FVisiblePointsVisiblePoints
 
TSet< int32TrisWithPoints
 
double VisibleDistanceThreshold = -FMathd::MaxReal
 

Member Function Documentation

◆ BuildNeighbors()

template<typename RealType >
void UE::Geometry::FHullConnectivity< RealType >::BuildNeighbors ( const TArray< FIndex3i > &  Triangles)
inline

Fully build neighbor connectivity; only on the initial tet, as after that we can incrementally update connectivity w/ mesh changes

◆ ChooseVisiblePoint()

template<typename RealType >
FIndex2i UE::Geometry::FHullConnectivity< RealType >::ChooseVisiblePoint ( bool  bChooseBestPoint)
inline
Parameters
bChooseBestPointWhether to choose the point with the highest value, rather than the first found point
Returns
A triangle index and visible-from-that-triangle point index that can be added to the hull next

◆ ClearVisiblePointsData()

template<typename RealType >
void UE::Geometry::FHullConnectivity< RealType >::ClearVisiblePointsData ( int32  TriIdx,
TArray< int32 > &  NewlyUnclaimed 
)
inline

◆ DeleteTriangles()

template<typename RealType >
void UE::Geometry::FHullConnectivity< RealType >::DeleteTriangles ( TArray< FIndex3i > &  Triangles,
const TSet< int32 > &  ToDelete 
)
inline

Remove a triangle and update connectivity accordingly. Removes by swapping, and updates references as needed. Note: removes a whole set at a time, because indices change during deletion

Parameters
TrianglesAll triangles
ToDeleteAll triangles to be deleted

◆ HorizonHelper()

template<typename RealType >
bool UE::Geometry::FHullConnectivity< RealType >::HorizonHelper ( const TArray< FIndex3i > &  Triangles,
TFunctionRef< TVector< RealType >(int32)>  GetPointFunc,
const TVector< RealType > &  Pt,
TArray< int32 > &  NewlyUnclaimed,
TSet< int32 > &  ToDelete,
TArray< FNewTriangle > &  ToAdd,
int32  TriIdx,
int32  CrossedEdgeFirstVertex,
bool  bCouldSkipPoint = false 
)
inline

Recursive traversal strategy that starts from a 'visible' triangle and walks to the connected set of all visible triangles, s.t. it visits the boundary in order See explanation here: http://algolist.ru/maths/geom/convhull/qhull3d.php

Parameters
TrianglesAll triangles
GetPointFuncPoint access function
PtCurrent 'eye point'; triangles will be deleted if this point is on the 'positive' side of the triangle
NewlyUnclaimed(Output) As we mark triangles for deletion, we move the visible points stored on the triangles to this giant list of points that need to be re-assigned (or culled) wrt the new triangles
ToDelete(Output) Set of all triangles that we will delete
ToAdd(Output) Info required to add and connect up new triangles to the eye point
TriIdxIndex of triangle to currently process
CrossedEdgeFirstVertexThe first vertex of the edge that was 'crossed over' to traverse to this TriIdx, or -1 for the initial call
Returns
false if triangle is beyond horizon (so we don't need to search through it / remove it), true otherwise

◆ InitVisibility()

template<typename RealType >
void UE::Geometry::FHullConnectivity< RealType >::InitVisibility ( const TArray< FIndex3i > &  Triangles,
int32  NumPoints,
TFunctionRef< TVector< RealType >(int32)>  GetPointFunc,
TFunctionRef< bool(int32)>  FilterFunc 
)
inline

Bucket all points based on which triangles can see them

◆ IsVisible()

template<typename RealType >
bool UE::Geometry::FHullConnectivity< RealType >::IsVisible ( const TVector< RealType >  TriPts[3],
const TVector< RealType > &  Pt 
)
inline
Returns
true if Pt is on the 'positive' side of the triangle

◆ RemoveVisiblePoint()

template<typename RealType >
void UE::Geometry::FHullConnectivity< RealType >::RemoveVisiblePoint ( FIndex2i  TriPointPair,
TFunctionRef< TVector< RealType >(int32)>  GetPointFunc 
)
inline
Parameters
TriPointPairA tri point pair, as returned from ChooseVisiblePoint, that should be removed from consideration

◆ SetTriPts()

template<typename RealType >
void UE::Geometry::FHullConnectivity< RealType >::SetTriPts ( const FIndex3i Tri,
TFunctionRef< TVector< RealType >(int32)>  GetPointFunc,
TVector< RealType >  TriPtsOut[3] 
)
inline

Set triangle positions to prep for IsVisible calls

◆ UpdateHullWithNewPoint()

template<typename RealType >
bool UE::Geometry::FHullConnectivity< RealType >::UpdateHullWithNewPoint ( TArray< FIndex3i > &  Triangles,
int32  NumPoints,
TFunctionRef< TVector< RealType >(int32)>  GetPointFunc,
int32  StartTriIdx,
int32  PtIdx,
RealType  DegenerateEdgeToleranceSq = (RealType)0 
)
inline

◆ UpdateNeighbor()

template<typename RealType >
void UE::Geometry::FHullConnectivity< RealType >::UpdateNeighbor ( TArray< FIndex3i > &  Triangles,
int32  TriIdx,
int32  EdgeFirstVertex,
int32  NewNbrIdx 
)
inline

Rewrite one neighbor connection (and NOT the backwards connection)

Parameters
TrianglesAll triangles
TriIdxThe triangle to update
EdgeFirstVertexThe first vertex of the edge that should be connected to the new neighbor
NewNbrIdxThe new neighbor to connect to

◆ UpdateNeighbors()

template<typename RealType >
void UE::Geometry::FHullConnectivity< RealType >::UpdateNeighbors ( int32  TriIdx,
int32  NewIdx 
)
inline

Update any neighbor "back pointers" to TriIdx to instead point to NewIdx Used during triangle deletion when we swap a triangle to a new index

◆ ValidateConnectivity()

template<typename RealType >
bool UE::Geometry::FHullConnectivity< RealType >::ValidateConnectivity ( TArray< FIndex3i > &  Triangles,
TSet< int32 Skip = TSet<int32>() 
)
inline

Debugging aid to validate the neighbor connectivity

Member Data Documentation

◆ TriNeighbors

template<typename RealType >
TArray<FIndex3i> UE::Geometry::FHullConnectivity< RealType >::TriNeighbors

◆ TrisWithPoints

template<typename RealType >
TSet<int32> UE::Geometry::FHullConnectivity< RealType >::TrisWithPoints

◆ VisibleDistanceThreshold

template<typename RealType >
double UE::Geometry::FHullConnectivity< RealType >::VisibleDistanceThreshold = -FMathd::MaxReal

◆ VisiblePoints

template<typename RealType >
TArray<FVisiblePoints> UE::Geometry::FHullConnectivity< RealType >::VisiblePoints

The documentation for this struct was generated from the following file: