FDynamicMeshOctree3

[FDynamicMeshOctree3](API\Plugins\DynamicMesh\FDynamicMeshOctree3) is an extension of [FSparseDynamicOctree3](API\Plugins\GeometricObjects\Spatial\FSparseDynamicOctree3) for the triangles of a [FDynamicMesh3](API\Plugins\DynamicMesh\FDynamicMesh3) instance.

Windows
MacOS
Linux

Inheritance Hierarchy

FSparseDynamicOctree3

FDynamicMeshOctree3

References

Module

DynamicMesh

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/DynamicMesh/Public/DynamicMeshOctree3.h

Include

#include "DynamicMeshOctree3.h"

Syntax

class FDynamicMeshOctree3 : public FSparseDynamicOctree3

Remarks

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...)

Variables

Name Description

Public variable

const FDynamicM ...

 

Mesh

Potential optimizations:

Public variable

FAxisAlignedBox ...

 

ModifiedBounds

Bounding box of triangles that have been inserted/removed since last clear

Functions

Name Description

Public function Const

FTreeCutSet

 

BuildLevelCutSet

(
    uint32 CutLevel
)

Public function Const

void

 

CheckValidity

(
    EValidityCheckFailMode FailMode,
    bool bVerbose,
    bool bFailOnMissingObjects
)

Check that the Octree is internally valid

Public function Const

void

 

CollectRootTriangles

(
    const FTreeCutSet & CutSet,
    TFunctionRef < void > TriangleFu...
)

Call TriangleFunc for all triangles in the octree "above" the CutSet (ie at tree cells that are not children of any cut cells)

Public function Const

void

 

CollectSpillTriangles

(
    TFunctionRef < void > TriangleFu...
)

Call TriangleFunc for any triangles in the spill set (ie not contained in any Root cell)

Public function Const

void

 

CollectTriangles

(
    const FCellReference & CellRef,
    TFunctionRef < void > TriangleFu...
)

Call TriangleFunc on any triangles in the branch of the tree starting at CellRef

Public function Const

int32

 

FindNearestHitObject

(
    const FRay3d & Ray,
    double MaxDistance
)

Find the nearest triangle of the mesh that is hit by the ray

Public function Const

int32

 

FindNearestHitObject

(
    const FRay3d & Ray,
    TFunctionRef < bool > IncludeTri...,
    double MaxDistance
)

Find the nearest triangle of the mesh that is hit by the ray

Public function

void

 

Initialize

(
    const FDynamicMesh3 * MeshIn
)

Add all triangles of MeshIn to the octree

Public function

void

 

InsertTriangle

(
    int32 TriangleID
)

Insert a triangle into the tree

Public function

void

 

InsertTriangles

(
    const TSet < int >& Triangles
)

Insert a set of triangles into the tree

Public function

void

 

InsertTriangles

(
    const TArray < int >& Triangles
)

Insert a list of triangles into the tree

Public function

void

 

NotifyPendingModification

(
    const TSet < int >& Triangles
)

Include the current bounds of a set of triangles in the ModifiedBounds box

Public function

void

 

NotifyPendingModification

(
    int TriangleID
)

Include the current bounds of a triangle in the ModifiedBounds box

Public function

void

 

ReinsertTriangles

(
    const TSet < int >& Triangles
)

Reinsert a set of triangles into the tree

Public function

bool

 

RemoveTriangle

(
    int32 TriangleID
)

Remove a triangle from the tree

Public function

void

 

RemoveTriangles

(
    const TSet < int >& Triangles
)

Remove a set of triangles into the tree

Public function

void

 

RemoveTriangles

(
    const TArray < int >& Triangles
)

Remove a list of triangles into the tree

Public function

void

 

ResetModifiedBounds()

Reset the internal ModifiedBounds box that tracks modified triangle bounds

Public function Const

bool

 

TestCellIntersection

(
    const FCellReference & CellRef,
    const FAxisAlignedBox3d & Bounds
)

Public function Const

void

 

UpdateLevelCutSet

(
    FTreeCutSet & CutSet,
    TArray < FCellReference >& NewCutCe...
)

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)

Classes

Name

Description

Public struct

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

Public class

FTreeCutSet

FTreeCutSet is a cut of the tree, ie a set of internal cells which are "parents" of separate branches

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback