Navigation
API > API/Runtime > API/Runtime/GeometryCore
FDynamicMeshOctree3 is an extension of FSparseDynamicOctree3 for the triangles of a FDynamicMesh3 instance. This extension does several things: 1) provides a simplified API based on triangle IDs to various Octree functions 2) tracks ModifiedBounds box of modified areas 3) support for computing/updating/querying a "Cut" of the octree, ie a set of cells which are roots of sub-branches that partition the tree. This is useful for splitting up mesh processing/rendering into spatially-coherent chunks. (This functionality should probably be extracted into a separate class...)
| Name | FDynamicMeshOctree3 |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/DynamicMesh/DynamicMeshOctree3.h |
| Include Path | #include "DynamicMesh/DynamicMeshOctree3.h" |
Syntax
class FDynamicMeshOctree3 : public UE::Geometry::FSparseDynamicOctree3
Inheritance Hierarchy
- FSparseDynamicOctree3 → FDynamicMeshOctree3
Classes
| Name | Remarks |
|---|---|
| FTreeCutSet | FTreeCutSet is a cut of the tree, ie a set of internal cells which are "parents" of separate branches |
Structs
| Name | Remarks |
|---|---|
| FCellReference | Support for building "cuts" of the octree, which are sets of internal nodes which can be used to decompose the tree (eg into spatially-coherent chunks of triangles, for example) FCellReference is a handle to an internal cell of the octree |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Mesh | const FDynamicMesh3 * | Potential optimizations: | DynamicMesh/DynamicMeshOctree3.h | |
| ModifiedBounds | FAxisAlignedBox3d | Bounding box of triangles that have been inserted/removed since last clear | DynamicMesh/DynamicMeshOctree3.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FTreeCutSet BuildLevelCutSet
(
uint32 CutLevel |
DynamicMesh/DynamicMeshOctree3.h | ||
void CheckValidity
(
EValidityCheckFailMode FailMode, |
Check that the Octree is internally valid | DynamicMesh/DynamicMeshOctree3.h | |
void CollectRootTriangles
(
const FTreeCutSet& CutSet, |
Call TriangleFunc for all triangles in the octree "above" the CutSet (ie at tree cells that are not children of any cut cells) | DynamicMesh/DynamicMeshOctree3.h | |
void CollectSpillTriangles
(
TFunctionRef< void(int)> TriangleFunc |
Call TriangleFunc for any triangles in the spill set (ie not contained in any Root cell) | DynamicMesh/DynamicMeshOctree3.h | |
void CollectTriangles
(
const FCellReference& CellRef, |
Call TriangleFunc on any triangles in the branch of the tree starting at CellRef | DynamicMesh/DynamicMeshOctree3.h | |
int32 FindNearestHitObject
(
const FRay3d& Ray, |
Find the nearest triangle of the mesh that is hit by the ray | DynamicMesh/DynamicMeshOctree3.h | |
int32 FindNearestHitObject
(
const FRay3d& Ray, |
Find the nearest triangle of the mesh that is hit by the ray | DynamicMesh/DynamicMeshOctree3.h | |
void Initialize
(
const FDynamicMesh3* MeshIn |
Add all triangles of MeshIn to the octree | DynamicMesh/DynamicMeshOctree3.h | |
void InsertTriangle
(
int32 TriangleID |
Insert a triangle into the tree | DynamicMesh/DynamicMeshOctree3.h | |
void InsertTriangles
(
const TSet< int >& Triangles |
Insert a set of triangles into the tree | DynamicMesh/DynamicMeshOctree3.h | |
void InsertTriangles
(
const TArray< int >& Triangles |
Insert a list of triangles into the tree | DynamicMesh/DynamicMeshOctree3.h | |
void NotifyPendingModification
(
const EnumerableType& Triangles |
Include the current bounds of a set of triangles in the ModifiedBounds box | DynamicMesh/DynamicMeshOctree3.h | |
void NotifyPendingModification
(
int TriangleID |
Include the current bounds of a triangle in the ModifiedBounds box | DynamicMesh/DynamicMeshOctree3.h | |
void ReinsertTriangles
(
const EnumerableType& Triangles |
Reinsert a set of triangles into the tree | DynamicMesh/DynamicMeshOctree3.h | |
void ReinsertTrianglesParallel
(
const TArray< int32 >& Triangles, |
Reinsert a set of triangles into the tree. | DynamicMesh/DynamicMeshOctree3.h | |
bool RemoveTriangle
(
int32 TriangleID |
Remove a triangle from the tree | DynamicMesh/DynamicMeshOctree3.h | |
void RemoveTriangles
(
const EnumerableType& Triangles, |
Remove a set of triangles into the tree | DynamicMesh/DynamicMeshOctree3.h | |
void ResetModifiedBounds() |
Reset the internal ModifiedBounds box that tracks modified triangle bounds | DynamicMesh/DynamicMeshOctree3.h | |
bool TestCellIntersection
(
const FCellReference& CellRef, |
DynamicMesh/DynamicMeshOctree3.h | ||
void UpdateLevelCutSet
(
FTreeCutSet& CutSet, |
For a fixed-level cut set created by BuildLevelCutSet, check that all current cells at that level are in the cut set (call this after adding/removing to the tree to make sure the CutSet is up to date) | DynamicMesh/DynamicMeshOctree3.h |