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

#include <MeshSpatialSort.h>

Classes

struct  FMeshNesting
 Outputs. More...
 

Public Types

enum class  ENestingMethod { InLargestParent , InSmallestParent }
 

Public Member Functions

 TMeshSpatialSort ()
 
 TMeshSpatialSort (TArrayView< const TriangleMeshType > InputMeshes, TArrayView< const FAxisAlignedBox3d > MeshBoundsIn=TArrayView< const FAxisAlignedBox3d >())
 
void Compute ()
 

Public Attributes

TArrayView< const TriangleMeshTypeInputMeshes
 
TArray< FAxisAlignedBox3dMeshBounds
 
ENestingMethod NestingMethod = ENestingMethod::InLargestParent
 
bool bOnlyNestNegativeVolumes = false
 
bool bOnlyParentPostiveVolumes = true
 
bool bOnlyCheckSingleVertexForNesting = true
 
TArray< FMeshNestingNests
 
TArray< int > SkippedMeshIndices
 

Detailed Description

template<class TriangleMeshType>
class UE::Geometry::TMeshSpatialSort< TriangleMeshType >

Sorts a list meshes into a list of "Nests" where each Nest has an outer shell mesh and a list of contained-inside meshes

For example, if you have a "Russian nesting doll" arrangement of meshes [A,B,C,D] where A holds B holds C holds D:

  • If NestingMethod is InSmallestParent, the output will be: Nest 1: Outer: A, Inner: B, Parent: Invalid Nest 2: Outer; C, Inner: D, Parent: B Nest 1 conceptually corresponds to the outer and inner walls of the first doll, and Nest 2 the same of the second doll. (Note if the orientation-related booleans are set to true, this would only hold if the mesh orientations are also alternating)
  • If NestingMethod is InLargestParent, the output will be: Nest 1: Outer: A; Inner: B, C, D; Parent: Invalid In this case Nest 1 conceptually corresponds to there being a single outer structure, and the inner structure is left unsorted (Note for InLargestParent mode, you typically want bOnlyNestNegativeVolumes to be false)

For similar functionality in 2D, see the TPlanarComplex class

Member Enumeration Documentation

◆ ENestingMethod

Enumerator
InLargestParent 
InSmallestParent 

Constructor & Destructor Documentation

◆ TMeshSpatialSort() [1/2]

template<class TriangleMeshType >
UE::Geometry::TMeshSpatialSort< TriangleMeshType >::TMeshSpatialSort ( )
inline

◆ TMeshSpatialSort() [2/2]

template<class TriangleMeshType >
UE::Geometry::TMeshSpatialSort< TriangleMeshType >::TMeshSpatialSort ( TArrayView< const TriangleMeshType InputMeshes,
TArrayView< const FAxisAlignedBox3d MeshBoundsIn = TArrayView<const FAxisAlignedBox3d>() 
)
inline

Member Function Documentation

◆ Compute()

template<class TriangleMeshType >
void UE::Geometry::TMeshSpatialSort< TriangleMeshType >::Compute ( )
inline

Member Data Documentation

◆ bOnlyCheckSingleVertexForNesting

template<class TriangleMeshType >
bool UE::Geometry::TMeshSpatialSort< TriangleMeshType >::bOnlyCheckSingleVertexForNesting = true

If true, we assume meshes don't intersect, so we can check if a whole mesh is inside another by testing a single vertex If false, we only consider a mesh inside another if every vertex of the smaller is inside the larger

◆ bOnlyNestNegativeVolumes

template<class TriangleMeshType >
bool UE::Geometry::TMeshSpatialSort< TriangleMeshType >::bOnlyNestNegativeVolumes = false

If true, only negative-volume meshes can be nested (i.e., can be included in an FMeshNesting InnerIndices array)

◆ bOnlyParentPostiveVolumes

template<class TriangleMeshType >
bool UE::Geometry::TMeshSpatialSort< TriangleMeshType >::bOnlyParentPostiveVolumes = true

If true, only positive-volume meshes can be assigned the "OuterIndex" of an FMeshNesting Leads to more logical nesting, but note: if true, a negative volume that isn't inside any positive volume mesh will not show up in any nests at all

◆ InputMeshes

Meshes to be spatially sorted

◆ MeshBounds

Optional array of bounding boxes for each mesh

◆ NestingMethod

Which algorithm is used to determine nesting

◆ Nests

◆ SkippedMeshIndices

template<class TriangleMeshType >
TArray<int> UE::Geometry::TMeshSpatialSort< TriangleMeshType >::SkippedMeshIndices

Indices of meshes that are not included in the "Nests" output, e.g. negative-volume meshes that are not inside any positive-volume mesh if bOnlyParentPostiveVolumes


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