UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::TMeshLocalParam< PointSetType > Class Template Reference

#include <MeshLocalParam.h>

Classes

struct  FGraphNode
 

Public Member Functions

 TMeshLocalParam (const PointSetType *PointSetIn)
 
void Reset ()
 
void ComputeToMaxDistance (const FFrame3d &SeedFrameIn, const FIndex3i &SeedNbrs, double ComputeToMaxDistanceIn)
 
void ComputeToMaxDistance (int32 CenterPointVtxID, const FFrame3d &CenterPointFrame, double ComputeToMaxDistanceIn)
 
void TransformUV (double Scale, FVector2d Translate)
 
double GetMaxGraphDistance () const
 
double GetMaxUVDistance () const
 
bool HasUV (int32 PointID) const
 
void GetPointsWithUV (TArray< int32 > &Points) const
 
FVector2d GetUV (int32 PointID) const
 
void GetAllComputedUVs (TArray< int32 > &PointIDsOut, TArray< FVector2d > &PointUVsOut, double MaxUVMagnitude=TNumericLimits< float >::Max(), double MaxGraphDist=TNumericLimits< float >::Max()) const
 
void ApplyUVs (TFunctionRef< void(int32 PointID, const FVector2d &UV)> ApplyFunc) const
 
FAxisAlignedBox2d GetUVBounds () const
 

Public Attributes

const PointSetTypePointSet
 
ELocalParamTypes ParamMode = ELocalParamTypes::ExponentialMapUpwindAvg
 
bool bEnableExternalNormals = false
 
TFunction< FVector3d(int32)> ExternalNormalFunc
 

Protected Member Functions

FVector3d GetPosition (const int32 PointID) const
 
FVector3d GetNormal (const int32 PointID) const
 
FFrame3d GetFrame (const FGraphNode &Node) const
 
void ProcessQueueUntilTermination (double MaxDistance)
 
FVector2d ComputeLocalUV (const FFrame3d &Frame, FVector3d Position) const
 
FVector2d PropagateUV (const FVector3d &Position, const FVector2d &NbrUV, const FFrame3d &NbrFrame, const FFrame3d &SeedFrameIn) const
 
void UpdateUVExpmap (FGraphNode &Node)
 
void UpdateUVExpmapUpwind (FGraphNode &Node)
 
void UpdateUVPlanar (FGraphNode &Node)
 
FGraphNodeGetNodeForPointSetID (int32 PointSetID, bool bCreateIfMissing)
 
const FGraphNodeGetNodeForPointSetID (int32 PointSetID) const
 
void UpdateNeighboursSparse (FGraphNode *Parent)
 

Static Protected Member Functions

static FVector2d InvalidUV ()
 

Protected Attributes

TMap< int32, int32IDToNodeIndexMap
 
TDynamicVector< FGraphNodeAllocatedNodes
 
FIndexPriorityQueue Queue
 
FFrame3d SeedFrame
 
double MaxGraphDistance
 
double MaxUVDistance
 

Detailed Description

template<class PointSetType>
class UE::Geometry::TMeshLocalParam< PointSetType >

TMeshLocalParam computes a local UV parameterization of a set of connected PointsWithNormals, where "local" means "in a geodesic disc around a starting point".

The computation is based on region-growing, and geodesic distances are actually graph distances, measured with Dijkstras algorithm.

Templated on the point set type, which must provide positions, normals, and neighbours. Currently will only work for FDynamicMesh3 and FDynamicPointSet3 because of call to PointSetType->VtxVerticesItr()

Constructor & Destructor Documentation

◆ TMeshLocalParam()

template<class PointSetType >
UE::Geometry::TMeshLocalParam< PointSetType >::TMeshLocalParam ( const PointSetType PointSetIn)
inline

Member Function Documentation

◆ ApplyUVs()

template<class PointSetType >
void UE::Geometry::TMeshLocalParam< PointSetType >::ApplyUVs ( TFunctionRef< void(int32 PointID, const FVector2d &UV)>  ApplyFunc) const
inline

Apply a function to each calculated UV

◆ ComputeLocalUV()

template<class PointSetType >
FVector2d UE::Geometry::TMeshLocalParam< PointSetType >::ComputeLocalUV ( const FFrame3d Frame,
FVector3d  Position 
) const
inlineprotected

◆ ComputeToMaxDistance() [1/2]

template<class PointSetType >
void UE::Geometry::TMeshLocalParam< PointSetType >::ComputeToMaxDistance ( const FFrame3d SeedFrameIn,
const FIndex3i SeedNbrs,
double  ComputeToMaxDistanceIn 
)
inline

Computes UVs outwards from seed frame/nbrs to all points that are less/equal to ComputeToMaxDistance from the seed.

Parameters
SeedFrameIn3D frame on surface of point set, parameterization is computed "in" this frame (eg will align u/v to x/y axes, at origin)
SeedNbrs3 points that will be planar-projected into the SeedFrame, to initialize the region-growing (kind of triangle-mesh-specific)
ComputeToMaxDistanceIntarget radius for parameterization, will not set UVs on points with graph-distance larger than this

◆ ComputeToMaxDistance() [2/2]

template<class PointSetType >
void UE::Geometry::TMeshLocalParam< PointSetType >::ComputeToMaxDistance ( int32  CenterPointVtxID,
const FFrame3d CenterPointFrame,
double  ComputeToMaxDistanceIn 
)
inline

Computes UVs outwards from seed vertex to all points that are less/equal to ComputeToMaxDistance from the seed.

Parameters
CenterPointVtxIDID of seed vertex
CenterPointFrame3D frame on surface of point set, parameterization is computed "in" this frame (eg will align u/v to x/y axes, at origin)
ComputeToMaxDistanceIntarget radius for parameterization, will not set UVs on points with graph-distance larger than this

◆ GetAllComputedUVs()

template<class PointSetType >
void UE::Geometry::TMeshLocalParam< PointSetType >::GetAllComputedUVs ( TArray< int32 > &  PointIDsOut,
TArray< FVector2d > &  PointUVsOut,
double  MaxUVMagnitude = TNumericLimits<float>::Max(),
double  MaxGraphDist = TNumericLimits<float>::Max() 
) const
inline

Find all computed UVs within the specified distances

Parameters
PointIDsOutPointID corresponding to each computed UV is returned here
PointUVsOutUV value corresponding to each PointID is returned here
MaxUVMagnitudecomputed UVs will only be included if their magnitude is smaller than this value (eg, this is the UV-space radius)
MaxGraphDistancecomputed UVs will only be included if their graph distance is smaller than this value. Graph distance is generally always be larger than UV distance. This can be used to avoid problematic UVs that might result from algorithm failures.

◆ GetFrame()

template<class PointSetType >
FFrame3d UE::Geometry::TMeshLocalParam< PointSetType >::GetFrame ( const FGraphNode Node) const
inlineprotected

◆ GetMaxGraphDistance()

template<class PointSetType >
double UE::Geometry::TMeshLocalParam< PointSetType >::GetMaxGraphDistance ( ) const
inline
Returns
the maximum graph distance/radius encountered during the computation

◆ GetMaxUVDistance()

template<class PointSetType >
double UE::Geometry::TMeshLocalParam< PointSetType >::GetMaxUVDistance ( ) const
inline
Returns
the maximum UV distance/radius encountered during the computation

◆ GetNodeForPointSetID() [1/2]

template<class PointSetType >
const FGraphNode * UE::Geometry::TMeshLocalParam< PointSetType >::GetNodeForPointSetID ( int32  PointSetID) const
inlineprotected

◆ GetNodeForPointSetID() [2/2]

template<class PointSetType >
FGraphNode * UE::Geometry::TMeshLocalParam< PointSetType >::GetNodeForPointSetID ( int32  PointSetID,
bool  bCreateIfMissing 
)
inlineprotected

◆ GetNormal()

template<class PointSetType >
FVector3d UE::Geometry::TMeshLocalParam< PointSetType >::GetNormal ( const int32  PointID) const
inlineprotected

◆ GetPointsWithUV()

template<class PointSetType >
void UE::Geometry::TMeshLocalParam< PointSetType >::GetPointsWithUV ( TArray< int32 > &  Points) const
inline
Returns
Array of points with set UVs.

◆ GetPosition()

template<class PointSetType >
FVector3d UE::Geometry::TMeshLocalParam< PointSetType >::GetPosition ( const int32  PointID) const
inlineprotected

◆ GetUV()

template<class PointSetType >
FVector2d UE::Geometry::TMeshLocalParam< PointSetType >::GetUV ( int32  PointID) const
inline
Returns
the UV calculated for index PointID

◆ GetUVBounds()

template<class PointSetType >
FAxisAlignedBox2d UE::Geometry::TMeshLocalParam< PointSetType >::GetUVBounds ( ) const
inline
Returns
2D Axis-Aligned Bounding Box of the calculated UVs

◆ HasUV()

template<class PointSetType >
bool UE::Geometry::TMeshLocalParam< PointSetType >::HasUV ( int32  PointID) const
inline
Returns
true if the UV for index PointID was calculated

◆ InvalidUV()

template<class PointSetType >
static FVector2d UE::Geometry::TMeshLocalParam< PointSetType >::InvalidUV ( )
inlinestaticprotected

◆ ProcessQueueUntilTermination()

template<class PointSetType >
void UE::Geometry::TMeshLocalParam< PointSetType >::ProcessQueueUntilTermination ( double  MaxDistance)
inlineprotected

◆ PropagateUV()

template<class PointSetType >
FVector2d UE::Geometry::TMeshLocalParam< PointSetType >::PropagateUV ( const FVector3d Position,
const FVector2d NbrUV,
const FFrame3d NbrFrame,
const FFrame3d SeedFrameIn 
) const
inlineprotected

◆ Reset()

template<class PointSetType >
void UE::Geometry::TMeshLocalParam< PointSetType >::Reset ( )
inline

Reset internal data structures but keep allocated memory

◆ TransformUV()

template<class PointSetType >
void UE::Geometry::TMeshLocalParam< PointSetType >::TransformUV ( double  Scale,
FVector2d  Translate 
)
inline

Scale and then Translate all calculated UV values

◆ UpdateNeighboursSparse()

template<class PointSetType >
void UE::Geometry::TMeshLocalParam< PointSetType >::UpdateNeighboursSparse ( FGraphNode Parent)
inlineprotected

◆ UpdateUVExpmap()

template<class PointSetType >
void UE::Geometry::TMeshLocalParam< PointSetType >::UpdateUVExpmap ( FGraphNode Node)
inlineprotected

◆ UpdateUVExpmapUpwind()

template<class PointSetType >
void UE::Geometry::TMeshLocalParam< PointSetType >::UpdateUVExpmapUpwind ( FGraphNode Node)
inlineprotected

◆ UpdateUVPlanar()

template<class PointSetType >
void UE::Geometry::TMeshLocalParam< PointSetType >::UpdateUVPlanar ( FGraphNode Node)
inlineprotected

Member Data Documentation

◆ AllocatedNodes

template<class PointSetType >
TDynamicVector<FGraphNode> UE::Geometry::TMeshLocalParam< PointSetType >::AllocatedNodes
protected

◆ bEnableExternalNormals

template<class PointSetType >
bool UE::Geometry::TMeshLocalParam< PointSetType >::bEnableExternalNormals = false

If true, ExternalNormalFunc will be used to fetch normals instead of requesting from PointSet->GetVertexNormal. This allows for (1) vertex normals to be computed on the fly, if only a subset of the point set is being parameterizedx and (2) alternate normals (eg smoothed, etc) to be provided w/o having to define a separate class.

◆ ExternalNormalFunc

Normals will be requested from this function if bEnableExternalNormals == true

◆ IDToNodeIndexMap

template<class PointSetType >
TMap<int32, int32> UE::Geometry::TMeshLocalParam< PointSetType >::IDToNodeIndexMap
protected

◆ MaxGraphDistance

template<class PointSetType >
double UE::Geometry::TMeshLocalParam< PointSetType >::MaxGraphDistance
protected

◆ MaxUVDistance

template<class PointSetType >
double UE::Geometry::TMeshLocalParam< PointSetType >::MaxUVDistance
protected

◆ ParamMode

Type of local parameterization to compute

◆ PointSet

◆ Queue

◆ SeedFrame

template<class PointSetType >
FFrame3d UE::Geometry::TMeshLocalParam< PointSetType >::SeedFrame
protected

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