Navigation
API > API/Runtime > API/Runtime/GeometryCore
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
| Name | TMeshSpatialSort |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/Spatial/MeshSpatialSort.h |
| Include Path | #include "Spatial/MeshSpatialSort.h" |
Syntax
template<class TriangleMeshType>
class TMeshSpatialSort
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Spatial/MeshSpatialSort.h | |||
TMeshSpatialSort
(
TArrayView< const TriangleMeshType > InputMeshes, |
Spatial/MeshSpatialSort.h |
Structs
| Name | Remarks |
|---|---|
| FMeshNesting | Outputs. |
Enums
Public
| Name | Remarks |
|---|---|
| ENestingMethod |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bOnlyCheckSingleVertexForNesting | bool | 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 | Spatial/MeshSpatialSort.h | |
| bOnlyNestNegativeVolumes | bool | If true, only negative-volume meshes can be nested (i.e., can be included in an FMeshNesting InnerIndices array) | Spatial/MeshSpatialSort.h | |
| bOnlyParentPostiveVolumes | bool | 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 | Spatial/MeshSpatialSort.h | |
| InputMeshes | TArrayView< const TriangleMeshType > | Meshes to be spatially sorted | Spatial/MeshSpatialSort.h | |
| MeshBounds | TArray< FAxisAlignedBox3d > | Optional array of bounding boxes for each mesh | Spatial/MeshSpatialSort.h | |
| NestingMethod | ENestingMethod | Which algorithm is used to determine nesting | Spatial/MeshSpatialSort.h | |
| Nests | TArray< FMeshNesting > | Computed nests | Spatial/MeshSpatialSort.h | |
| SkippedMeshIndices | TArray< int > | 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 | Spatial/MeshSpatialSort.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Compute() |
Spatial/MeshSpatialSort.h |