![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <MeshDijkstra.h>
Classes | |
| struct | FSeedPoint |
Public Member Functions | |
| TMeshDijkstra (const PointSetType *PointSetIn) | |
| void | Reset () |
| void | ComputeToMaxDistance (const TArray< FSeedPoint > &SeedPointsIn, double ComputeToMaxDistanceIn) |
| void | ComputeToMaxDistance (const TArray< FVector2d > &SeedPointsIn, double ComputeToMaxDistanceIn) |
| bool | ComputeToTargetPoint (const TArray< FSeedPoint > &SeedPointsIn, int32 TargetPointID, double ComputeToMaxDistanceIn=TNumericLimits< double >::Max()) |
| double | GetMaxGraphDistance () const |
| int32 | GetMaxGraphDistancePointID () const |
| int32 | GetSeedExternalIDForPointSetID (int32 PointID) |
| bool | HasDistance (int32 PointID) const |
| double | GetDistance (int32 PointID) const |
| bool | FindPathToNearestSeed (int32 PointID, TArray< int32 > &PathToSeedOut, int32 MaxLength=100000) |
Static Public Member Functions | |
| static double | InvalidDistance () |
Public Attributes | |
| const PointSetType * | PointSet |
| TUniqueFunction< FVector3d(int32)> | GetPositionFunc |
| bool | bEnableDistanceWeighting = false |
| TUniqueFunction< double(int32 FromVID, int32 ToVID, int32 SeedVID, double EuclideanDistance)> | GetWeightedDistanceFunc |
TMeshDijkstra computes graph distances on a mesh from seed point(s) using Dijkstra's 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()
|
inline |
Construct TMeshDijkstra for the given PointSet. We will hold a reference to this PointSet for the lifetime of the class.
|
inline |
Computes graph distances outwards from seed points to all points that are less/equal to ComputeToMaxDistance from the seed.
| SeedPointsIn | seed points used to initialize computation, ie geodesics propagate out from this point set |
| ComputeToMaxDistance | target graph-distance radius, will not compute/set distances on points with graph-distance larger than this |
|
inline |
Computes graph distances outwards from seed points to all points that are less/equal to ComputeToMaxDistance from the seed.
| SeedPointsIn | 2D tuples that define seed points as (PointID, InitialDistance) pairs |
| ComputeToMaxDistance | target graph-distance radius, will not compute/set distances on points with graph-distance larger than this |
|
inline |
Computes graph distances outwards from seed points to all points that are less/equal to ComputeToMaxDistance from the seed, or until TargetPointID is reached. This is useful for finding shortest paths between two points
| SeedPointsIn | seed points used to initialize computation, ie geodesics propagate out from this point set |
| TargetPointID | the target point, computation stops when this point is reached |
| ComputeToMaxDistance | target graph-distance radius, will not compute/set distances on points with graph-distance larger than this |
|
inline |
Find path from a point to the nearest seed point
| PointID | starting point, assumption is that we have computed dijkstra to this point |
| PathToSeedOut | path is returned here, includes PointID and seed point as last element |
| MaxLength | if PathToSeedOut grows beyond this length, we abort the search |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
Reset internal data structures but keep allocated memory
| bool UE::Geometry::TMeshDijkstra< PointSetType >::bEnableDistanceWeighting = false |
If enabled, when computing local point-pair distances, GetWeightedDistanceFunc() will be called with the Euclidean distance to allow for alternative metrics
| TUniqueFunction<FVector3d(int32)> UE::Geometry::TMeshDijkstra< PointSetType >::GetPositionFunc |
Return the 3D Position of a given Point in the PointSet. This function is set to PointSet->GetVertex() in the constructor below, but can be replaced with an external function if necessary (eg to provide deformed mesh positions, etc)
| TUniqueFunction<double(int32 FromVID, int32 ToVID, int32 SeedVID, double EuclideanDistance)> UE::Geometry::TMeshDijkstra< PointSetType >::GetWeightedDistanceFunc |
Called when computing pairwise point distances between neighbours FromVID and ToVID, to allow for alternative distance metrics. SeedVID is the seed point that FromVID's value was propagated from (ie point reached by gradient walk) EuclideanDistance is the distance between the two input points
| const PointSetType* UE::Geometry::TMeshDijkstra< PointSetType >::PointSet |
PointSet we are calculating on