UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IndexUtil Namespace Reference

Functions

template<typename T >
bool SamePairUnordered (T a0, T a1, T b0, T b1)
 
int FindSharedEdgeVertex (const FIndex2i &EdgeVerts1, const FIndex2i &EdgeVerts2)
 
int FindEdgeOtherVertex (const FIndex2i &EdgeVerts, int VertexID)
 
template<typename T , typename Vec >
int FindTriIndex (T VertexID, const Vec &TriangleVerts)
 
template<typename T , typename Vec >
int FindEdgeIndexInTri (T VertexID1, T VertexID2, const Vec &TriangleVerts)
 
template<typename T , typename Vec >
int FindTriOrderedEdge (T VertexID1, T VertexID2, const Vec &TriangleVerts)
 
template<typename T , typename Vec >
int FindTriOtherVtxUnsafe (T VertexID1, T VertexID2, const Vec &TriangleVerts)
 
template<typename T , typename Vec >
int FindTriOtherVtx (T VertexID1, T VertexID2, const Vec &TriangleVerts)
 
int FindTriOtherVtx (int VertexID1, int VertexID2, const TDynamicVector< FIndex3i > &TriIndexArray, int TriangleIndex)
 
template<typename T , typename Vec >
int FindTriOtherIndex (T VertexID1, T VertexID2, const Vec &TriangleVerts)
 
int GetOtherTriIndex (int i0, int i1)
 
template<typename T , typename Vec >
bool OrientTriEdge (T &Vertex1, T &Vertex2, const Vec &TriangleVerts)
 
template<typename T , typename Vec >
int OrientTriEdgeAndFindOtherVtx (T &Vertex1, T &Vertex2, const Vec &TriangleVerts)
 
template<typename Func >
void ApplyMap (FIndex3i &Val, Func MapFunc)
 
template<typename T , typename Func >
void ApplyMap (UE::Math::TVector< T > &Val, Func MapFunc)
 
template<typename Func >
FIndex3i ApplyMap (const FIndex3i &Val, Func MapFunc)
 
template<typename T , typename Func >
UE::Math::TVector< T > ApplyMap (const UE::Math::TVector< T > &Val, Func MapFunc)
 
template<typename T , typename Func >
bool ArrayCheck (const TArray< T > &ToCheck, Func CheckFn)
 

Variables

GEOMETRYCORE_API const FVector2i GridOffsets4 [4]
 
GEOMETRYCORE_API const FVector2i GridOffsets8 [8]
 
GEOMETRYCORE_API const FVector3i GridOffsets6 [6]
 
GEOMETRYCORE_API const FVector3i GridOffsets26 [26]
 
GEOMETRYCORE_API const int BoxFaces [6][4]
 
GEOMETRYCORE_API const FVector2i BoxFacesUV [4] = { UV00, UV10, UV11, UV01 }
 
GEOMETRYCORE_API const int BoxFaceNormals [6] = { -3, 3, -1, 1, -2, 2 }
 

Function Documentation

◆ ApplyMap() [1/4]

template<typename Func >
FIndex3i IndexUtil::ApplyMap ( const FIndex3i Val,
Func  MapFunc 
)
Returns
MapFunc[Val] using index operator

◆ ApplyMap() [2/4]

template<typename T , typename Func >
UE::Math::TVector< T > IndexUtil::ApplyMap ( const UE::Math::TVector< T > &  Val,
Func  MapFunc 
)
Returns
MapFunc[Val] using index operator

◆ ApplyMap() [3/4]

template<typename Func >
void IndexUtil::ApplyMap ( FIndex3i Val,
Func  MapFunc 
)

Replace Val with MapFunc[Val] using index operator

◆ ApplyMap() [4/4]

template<typename T , typename Func >
void IndexUtil::ApplyMap ( UE::Math::TVector< T > &  Val,
Func  MapFunc 
)

Replace Val with MapFunc[Val] using index operator

◆ ArrayCheck()

template<typename T , typename Func >
bool IndexUtil::ArrayCheck ( const TArray< T > &  ToCheck,
Func  CheckFn 
)
Returns
false if CheckFn returns false on any element of ToCheck, true otherwise

◆ FindEdgeIndexInTri()

template<typename T , typename Vec >
int IndexUtil::FindEdgeIndexInTri ( VertexID1,
VertexID2,
const Vec TriangleVerts 
)
inline

Find unordered edge [VertexID1,VertexID2] in TriangleVerts

Returns
index in range 0-2, or InvalidID if not found

◆ FindEdgeOtherVertex()

int IndexUtil::FindEdgeOtherVertex ( const FIndex2i EdgeVerts,
int  VertexID 
)
inline
Returns
the vertex in the pair ev that is not v, or InvalidID if not found

◆ FindSharedEdgeVertex()

int IndexUtil::FindSharedEdgeVertex ( const FIndex2i EdgeVerts1,
const FIndex2i EdgeVerts2 
)
inline
Returns
the vertex that is the same in both EdgeVerts1 and EdgeVerts2, or InvalidID if not found

◆ FindTriIndex()

template<typename T , typename Vec >
int IndexUtil::FindTriIndex ( VertexID,
const Vec TriangleVerts 
)
inline
Returns
index 0/1/2 of VertexID in TriangleVerts, or InvalidID if not found

◆ FindTriOrderedEdge()

template<typename T , typename Vec >
int IndexUtil::FindTriOrderedEdge ( VertexID1,
VertexID2,
const Vec TriangleVerts 
)
inline

Find ordered edge [VertexID1,VertexID2] in TriangleVerts

Returns
index in range 0-2, or InvalidID if not found

◆ FindTriOtherIndex()

template<typename T , typename Vec >
int IndexUtil::FindTriOtherIndex ( VertexID1,
VertexID2,
const Vec TriangleVerts 
)
inline

Find ordered edge [VertexID1,VertexID2] in TriangleVerts and then return the index of the remaining third vertex

Returns
index of third vertex, or InvalidID if not found

◆ FindTriOtherVtx() [1/2]

int IndexUtil::FindTriOtherVtx ( int  VertexID1,
int  VertexID2,
const TDynamicVector< FIndex3i > &  TriIndexArray,
int  TriangleIndex 
)
inline

Find ordered edge [VertexID1,VertexID2] in a triangle that is in an array of triangles, and return remaining third vertex

Parameters
VertexID1first vertex of edge
VertexID2second vertex of edge
TriIndexArrayarray of triangle tuples
TriangleIndexwhich triangle in array to search
Returns
vertex id of other vertex, or InvalidID if not found

◆ FindTriOtherVtx() [2/2]

template<typename T , typename Vec >
int IndexUtil::FindTriOtherVtx ( VertexID1,
VertexID2,
const Vec TriangleVerts 
)
inline

Find ordered edge [VertexID1,VertexID2] in TriangleVerts and then return the remaining third vertex

Returns
vertex id of other vertex, or InvalidID if not found

◆ FindTriOtherVtxUnsafe()

template<typename T , typename Vec >
int IndexUtil::FindTriOtherVtxUnsafe ( VertexID1,
VertexID2,
const Vec TriangleVerts 
)
inline

Find third vertex of triangle that is not VertexID1 or VertexID2. Triangle must contain VertexID1 and VertexID2 or result will be incorrect.

Returns
VertexID of third vertex, or incorrect result if precondition is not met

◆ GetOtherTriIndex()

int IndexUtil::GetOtherTriIndex ( int  i0,
int  i1 
)
inline

If i0 and i1 are unordered indices into a triangle, each in range 0-2, return the third index

◆ OrientTriEdge()

template<typename T , typename Vec >
bool IndexUtil::OrientTriEdge ( T &  Vertex1,
T &  Vertex2,
const Vec TriangleVerts 
)
inline

Assuming [Vertex1,Vertex2] is an unordered edge in TriangleVerts, return Vertex1 and Vertex2 in the correct order (ie the same as TriangleVerts)

Warning
result is garbage if either vertex is not an edge in TriangleVerts
Returns
true if order was swapped

◆ OrientTriEdgeAndFindOtherVtx()

template<typename T , typename Vec >
int IndexUtil::OrientTriEdgeAndFindOtherVtx ( T &  Vertex1,
T &  Vertex2,
const Vec TriangleVerts 
)
inline

Assuming [Vertex1,Vertex2] is an unordered edge in TriangleVerts, return Vertex1 and Vertex2 in the correct order (ie the same as TriangleVerts), and returns the vertex ID of the other vertex

Returns
ID of third vertex, or InvalidID if the edge was not found

◆ SamePairUnordered()

template<typename T >
bool IndexUtil::SamePairUnordered ( a0,
a1,
b0,
b1 
)
inline
Returns
true if [a0,a1] and [b0,b1] are the same pair, ignoring order

Variable Documentation

◆ BoxFaceNormals

const int IndexUtil::BoxFaceNormals = { -3, 3, -1, 1, -2, 2 }
extern

Box Face Normal Axes associated with BoxFaces. Use Sign(BoxFaceNormals[i]) * Box.Axis( Abs(BoxFaceNormals[i])-1 ) to get vector

◆ BoxFaces

const int IndexUtil::BoxFaces
extern
Initial value:
=
{
{ 0, 1, 2, 3 },
{ 5, 4, 7, 6 },
{ 4, 0, 3, 7 },
{ 1, 5, 6, 2 },
{ 4, 5, 1, 0 },
{ 3, 2, 6, 7 }
}

Corner vertices of box faces - see FOrientedBox3.GetCorner for points associated w/ indexing

◆ BoxFacesUV

const FVector2i IndexUtil::BoxFacesUV = { UV00, UV10, UV11, UV01 }
extern

Corner unit-UV ordering of box faces - {0,0}, {1,0}, {1,1}, {0,1}

◆ GridOffsets26

const FVector3i IndexUtil::GridOffsets26
extern
Initial value:
=
{
FVector3i(0, 0,-1), FVector3i(0, 0, 1),
FVector3i(-1, 0, 0), FVector3i(1, 0, 0),
FVector3i(0,-1, 0), FVector3i(0, 1, 0),
FVector3i(1, 1, 0), FVector3i(-1, 1, 0),
FVector3i(0, 1, 1), FVector3i(0, 1,-1),
FVector3i(1, 0, 1), FVector3i(-1, 0, 1),
FVector3i(1, 0,-1), FVector3i(-1, 0,-1),
FVector3i(1, -1, 0), FVector3i(-1,-1, 0),
FVector3i(0, -1, 1), FVector3i(0,-1,-1),
FVector3i(1, 1, 1), FVector3i(-1, 1, 1),
FVector3i(1, 1,-1), FVector3i(-1, 1,-1),
FVector3i(1,-1, 1), FVector3i(-1,-1, 1),
FVector3i(1,-1,-1), FVector3i(-1,-1,-1)
}

all permutations of (+-1, +-1, +-1), can be used to iterate over connected face/edge/corner neighbours of a grid cell

◆ GridOffsets4

const FVector2i IndexUtil::GridOffsets4
extern
Initial value:
=
{
FVector2i(-1, 0), FVector2i(1, 0),
FVector2i(0, -1), FVector2i(0, 1)
}

integer indices offsets in x/y directions

◆ GridOffsets6

const FVector3i IndexUtil::GridOffsets6
extern
Initial value:
=
{
FVector3i( 0, 0,-1), FVector3i( 0, 0, 1),
FVector3i(-1, 0, 0), FVector3i( 1, 0, 0),
FVector3i( 0,-1, 0), FVector3i( 0, 1, 0)
}

integer indices offsets in x/y/z directions, corresponds w/ BoxFaces directions

◆ GridOffsets8

const FVector2i IndexUtil::GridOffsets8
extern
Initial value:
=
{
FVector2i(-1, 0), FVector2i(1, 0),
FVector2i(0, -1), FVector2i(0, 1),
FVector2i(-1, 1), FVector2i(1, 1),
FVector2i(-1, -1), FVector2i(1, -1)
}

integer indices offsets in x/y directions and diagonals