UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TBVTree< InElementType, InAllocator > Struct Template Reference

#include <BVTree.h>

Classes

struct  FElementBox
 

Public Types

typedef InElementType FElement
 

Public Member Functions

 TBVTree ()
 
 TBVTree (const TArray< FElement > &InElements)
 
 TBVTree (TArray< FElement > &&InElements)
 
void RecreateTree ()
 
void RecreateTree (const TArray< FElement > &InElements)
 
void RecreateTree (TArray< FElement > &&InElements)
 
void GetOverlapping (const FBox &Box, TArray< FElement > &OutOverlappingElements) const
 
const TArray< int16, InAllocator > & GetNodes () const
 
const TArray< FBox, InAllocator > & GetBoundingBoxes () const
 
const TArray< FElement > & GetElements () const
 
TArray< FElement > & GetElements ()
 
bool IsEmpty () const
 

Protected Member Functions

void Subdivide (TArray< FElementBox > &ElementBBoxes, const int StartIndex, const int LimitIndex, int &CurrentNode)
 
void Reset ()
 
void Create (const TArray< FElement > &InElements)
 
void Create (TArray< FElement > &&InElements)
 
void CreateCommonInternal ()
 

Static Protected Member Functions

static FBox CalcNodeBounds (const TArray< FElementBox > &ElementBBoxes, const int StartIndex, const int LimitIndex)
 
static int GetLongestAxis (const FBox &NodeBounds)
 
static FBox CalcElementBounds (const FElement &)
 

Detailed Description

template<typename InElementType, typename InAllocator = FDefaultAllocator>
struct TBVTree< InElementType, InAllocator >

BVTree - Bounding Volumes Tree

A binary search tree where each node has a Bounding Volume which is either an element (leaf nodes) or a volume encompassing all of its children (non-leaf nodes).

It provides fast gathering of all bounding volumes overlapping a given FBox (see GetOverlapping).

Users are expected to provide an implementation of CalcElementBounds for ElementType: static FBox CalcElementBounds(const FElement& Element) const

Member Typedef Documentation

◆ FElement

Constructor & Destructor Documentation

◆ TBVTree() [1/3]

template<typename InElementType , typename InAllocator = FDefaultAllocator>
TBVTree< InElementType, InAllocator >::TBVTree ( )
inline

◆ TBVTree() [2/3]

template<typename InElementType , typename InAllocator = FDefaultAllocator>
TBVTree< InElementType, InAllocator >::TBVTree ( const TArray< FElement > &  InElements)
inline

◆ TBVTree() [3/3]

template<typename InElementType , typename InAllocator = FDefaultAllocator>
TBVTree< InElementType, InAllocator >::TBVTree ( TArray< FElement > &&  InElements)
inline

Member Function Documentation

◆ CalcElementBounds()

template<typename InElementType , typename InAllocator = FDefaultAllocator>
static FBox TBVTree< InElementType, InAllocator >::CalcElementBounds ( const FElement )
staticprotected

◆ CalcNodeBounds()

template<typename InElementType , typename InAllocator = FDefaultAllocator>
static FBox TBVTree< InElementType, InAllocator >::CalcNodeBounds ( const TArray< FElementBox > &  ElementBBoxes,
const int  StartIndex,
const int  LimitIndex 
)
inlinestaticprotected

◆ Create() [1/2]

template<typename InElementType , typename InAllocator = FDefaultAllocator>
void TBVTree< InElementType, InAllocator >::Create ( const TArray< FElement > &  InElements)
inlineprotected

◆ Create() [2/2]

template<typename InElementType , typename InAllocator = FDefaultAllocator>
void TBVTree< InElementType, InAllocator >::Create ( TArray< FElement > &&  InElements)
inlineprotected

◆ CreateCommonInternal()

template<typename InElementType , typename InAllocator = FDefaultAllocator>
void TBVTree< InElementType, InAllocator >::CreateCommonInternal ( )
inlineprotected

◆ GetBoundingBoxes()

template<typename InElementType , typename InAllocator = FDefaultAllocator>
const TArray< FBox, InAllocator > & TBVTree< InElementType, InAllocator >::GetBoundingBoxes ( ) const
inline

◆ GetElements() [1/2]

template<typename InElementType , typename InAllocator = FDefaultAllocator>
TArray< FElement > & TBVTree< InElementType, InAllocator >::GetElements ( )
inline

◆ GetElements() [2/2]

template<typename InElementType , typename InAllocator = FDefaultAllocator>
const TArray< FElement > & TBVTree< InElementType, InAllocator >::GetElements ( ) const
inline

◆ GetLongestAxis()

template<typename InElementType , typename InAllocator = FDefaultAllocator>
static int TBVTree< InElementType, InAllocator >::GetLongestAxis ( const FBox NodeBounds)
inlinestaticprotected

◆ GetNodes()

template<typename InElementType , typename InAllocator = FDefaultAllocator>
const TArray< int16, InAllocator > & TBVTree< InElementType, InAllocator >::GetNodes ( ) const
inline

◆ GetOverlapping()

template<typename InElementType , typename InAllocator = FDefaultAllocator>
void TBVTree< InElementType, InAllocator >::GetOverlapping ( const FBox Box,
TArray< FElement > &  OutOverlappingElements 
) const
inline

◆ IsEmpty()

template<typename InElementType , typename InAllocator = FDefaultAllocator>
bool TBVTree< InElementType, InAllocator >::IsEmpty ( ) const
inline

◆ RecreateTree() [1/3]

template<typename InElementType , typename InAllocator = FDefaultAllocator>
void TBVTree< InElementType, InAllocator >::RecreateTree ( )
inline

◆ RecreateTree() [2/3]

template<typename InElementType , typename InAllocator = FDefaultAllocator>
void TBVTree< InElementType, InAllocator >::RecreateTree ( const TArray< FElement > &  InElements)
inline

◆ RecreateTree() [3/3]

template<typename InElementType , typename InAllocator = FDefaultAllocator>
void TBVTree< InElementType, InAllocator >::RecreateTree ( TArray< FElement > &&  InElements)
inline

◆ Reset()

template<typename InElementType , typename InAllocator = FDefaultAllocator>
void TBVTree< InElementType, InAllocator >::Reset ( )
inlineprotected

◆ Subdivide()

template<typename InElementType , typename InAllocator = FDefaultAllocator>
void TBVTree< InElementType, InAllocator >::Subdivide ( TArray< FElementBox > &  ElementBBoxes,
const int  StartIndex,
const int  LimitIndex,
int &  CurrentNode 
)
inlineprotected

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