UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric > Class Template Reference

#include <DynamicBVH.h>

Classes

struct  FNode
 

Public Member Functions

 FDynamicBVH ()
 
int32 GetNumNodes () const
 
int32 GetNumLeaves () const
 
int32 GetNumDirty () const
 
template<typename T >
void Add (const TBounds< T > &Bounds, uint32 Index)
 
template<typename T >
void Update (const TBounds< T > &Bounds, uint32 Index)
 
void Remove (uint32 Index)
 
bool IsPresent (uint32 Index) const
 
void AddDefaulted ()
 
void SwapIndexes (uint32 Index0, uint32 Index1)
 
void Build (const TArray< FBounds3f > &BoundsArray, uint32 FirstIndex)
 
template<typename T , typename FFuncType >
void ForAll (const TBounds< T > &Bounds, const FFuncType &Func) const
 
template<typename FPredicate , typename FFuncType >
void ForAll (const FPredicate &Predicate, const FFuncType &Func) const
 
template<typename FFuncType >
void ForAllDirty (const FFuncType &Func)
 
template<typename T , typename FFuncType >
uint32 FindClosest (const UE::Math::TVector< T > &Position, const FFuncType &LeafDistSqr)
 
const FBounds3fGetBounds (uint32 Index) const
 
float GetTotalCost () const
 
bool Check () const
 
template<typename T >
FORCEINLINE void Add (const TBounds< T > &Bounds, uint32 Index)
 
template<typename T >
FORCEINLINE void Update (const TBounds< T > &Bounds, uint32 Index)
 

Public Attributes

uint32 NumTested = 0
 

Protected Member Functions

FNodeGetNode (uint32 NodeIndex)
 
const FNodeGetNode (uint32 NodeIndex) const
 
void MarkDirty (uint32 NodeIndex)
 
void Set (uint32 NodeIndex, const FBounds3f &Bounds, uint32 FirstChild)
 
void SetBounds (uint32 NodeIndex, const FBounds3f &Bounds)
 
void SetFirstChild (uint32 NodeIndex, uint32 FirstChild)
 
uint32 FindBestInsertion_BranchAndBound (uint32 NodeIndex, const FBounds3f &RESTRICT Bounds)
 
uint32 FindBestInsertion_Greedy (uint32 NodeIndex, const FBounds3f &RESTRICT Bounds)
 
uint32 Insert (FRoot &RESTRICT Root, const FBounds3f &RESTRICT Bounds, uint32 NodeIndex)
 
void Extract (uint32 NodeIndex)
 
void RemoveAndSwap (uint32 NodeIndex)
 
bool RecursivePromoteChild (uint32 NodeIndex)
 
uint32 PromoteChild (uint32 NodeIndex)
 
void Rotate (uint32 NodeIndex)
 
uint32 AllocNode ()
 
void FreeNode (uint32 NodeIndex)
 
void CheckNode (uint32 NodeIndex) const
 

Protected Attributes

TArray< FNodeNodes
 
TArray< uint32Leaves
 
uint32 FreeHead = ~0u
 
FLowestCostList Candidates
 

Static Protected Attributes

static constexpr uint32 IndexShift = ConstLog2( MaxChildren )
 
static constexpr uint32 ChildMask = MaxChildren - 1
 
static constexpr uint32 MaxChildren4 = (MaxChildren + 3) / 4
 

Constructor & Destructor Documentation

◆ FDynamicBVH()

Member Function Documentation

◆ Add() [1/2]

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
template<typename T >
void FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::Add ( const TBounds< T > &  Bounds,
uint32  Index 
)

◆ Add() [2/2]

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
template<typename T >
FORCEINLINE void FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::Add ( const TBounds< T > &  Bounds,
uint32  Index 
)

◆ AddDefaulted()

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
void FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::AddDefaulted ( )
inline

◆ AllocNode()

◆ Build()

void FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::Build ( const TArray< FBounds3f > &  BoundsArray,
uint32  FirstIndex 
)

◆ Check()

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
bool FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::Check ( ) const
inline

◆ CheckNode()

void FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::CheckNode ( uint32  NodeIndex) const
protected

◆ Extract()

◆ FindBestInsertion_BranchAndBound()

uint32 FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::FindBestInsertion_BranchAndBound ( uint32  NodeIndex,
const FBounds3f &RESTRICT  Bounds 
)
protected

◆ FindBestInsertion_Greedy()

uint32 FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::FindBestInsertion_Greedy ( uint32  NodeIndex,
const FBounds3f &RESTRICT  Bounds 
)
protected

◆ FindClosest()

template<typename T , typename FFuncType >
uint32 FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::FindClosest ( const UE::Math::TVector< T > &  Position,
const FFuncType LeafDistSqr 
)

◆ ForAll() [1/2]

void FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::ForAll ( const FPredicate Predicate,
const FFuncType Func 
) const

◆ ForAll() [2/2]

template<typename T , typename FFuncType >
void FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::ForAll ( const TBounds< T > &  Bounds,
const FFuncType Func 
) const

◆ ForAllDirty()

◆ FreeNode()

◆ GetBounds()

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
const FBounds3f & FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::GetBounds ( uint32  Index) const
inline

◆ GetNode() [1/2]

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
FNode & FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::GetNode ( uint32  NodeIndex)
inlineprotected

◆ GetNode() [2/2]

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
const FNode & FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::GetNode ( uint32  NodeIndex) const
inlineprotected

◆ GetNumDirty()

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
int32 FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::GetNumDirty ( ) const
inline

◆ GetNumLeaves()

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
int32 FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::GetNumLeaves ( ) const
inline

◆ GetNumNodes()

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
int32 FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::GetNumNodes ( ) const
inline

◆ GetTotalCost()

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
float FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::GetTotalCost ( ) const
inline

◆ Insert()

uint32 FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::Insert ( FRoot &RESTRICT  Root,
const FBounds3f &RESTRICT  Bounds,
uint32  NodeIndex 
)
protected

◆ IsPresent()

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
bool FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::IsPresent ( uint32  Index) const
inline

◆ MarkDirty()

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
void FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::MarkDirty ( uint32  NodeIndex)
inlineprotected

◆ PromoteChild()

uint32 FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::PromoteChild ( uint32  NodeIndex)
protected

◆ RecursivePromoteChild()

bool FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::RecursivePromoteChild ( uint32  NodeIndex)
protected

◆ Remove()

◆ RemoveAndSwap()

void FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::RemoveAndSwap ( uint32  NodeIndex)
protected

◆ Rotate()

◆ Set()

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
void FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::Set ( uint32  NodeIndex,
const FBounds3f Bounds,
uint32  FirstChild 
)
inlineprotected

◆ SetBounds()

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
void FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::SetBounds ( uint32  NodeIndex,
const FBounds3f Bounds 
)
inlineprotected

◆ SetFirstChild()

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
void FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::SetFirstChild ( uint32  NodeIndex,
uint32  FirstChild 
)
inlineprotected

◆ SwapIndexes()

◆ Update() [1/2]

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
template<typename T >
void FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::Update ( const TBounds< T > &  Bounds,
uint32  Index 
)

◆ Update() [2/2]

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
template<typename T >
FORCEINLINE void FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::Update ( const TBounds< T > &  Bounds,
uint32  Index 
)

Member Data Documentation

◆ Candidates

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
FLowestCostList FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::Candidates
protected

◆ ChildMask

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
constexpr uint32 FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::ChildMask = MaxChildren - 1
staticconstexprprotected

◆ FreeHead

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
uint32 FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::FreeHead = ~0u
protected

◆ IndexShift

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
constexpr uint32 FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::IndexShift = ConstLog2( MaxChildren )
staticconstexprprotected

◆ Leaves

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
TArray< uint32 > FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::Leaves
protected

◆ MaxChildren4

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
constexpr uint32 FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::MaxChildren4 = (MaxChildren + 3) / 4
staticconstexprprotected

◆ Nodes

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
TArray< FNode > FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::Nodes
protected

◆ NumTested

template<uint32 MaxChildren, typename FRootPolicy = FSingleRoot, typename FDirtyPolicy = FIgnoreDirty, typename FCostMetric = FSurfaceAreaHeuristic>
uint32 FDynamicBVH< MaxChildren, FRootPolicy, FDirtyPolicy, FCostMetric >::NumTested = 0

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