![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <GenericQuadTree.h>
Public Member Functions | |
| TQuadTree () | |
| TQuadTree (const FBox2D &InBox, float InMinimumQuadSize=100.f) | |
| const FBox2D & | GetTreeBox () const |
| void | Insert (const ElementType &Element, const FBox2D &Box, const TCHAR *DebugContext=nullptr) |
| template<typename ElementAllocatorType > | |
| void | GetElements (const FBox2D &Box, TArray< ElementType, ElementAllocatorType > &ElementsOut) const |
| template<typename CallbackType > | |
| void | GetElements (const FBox2D &Box, CallbackType &&Callback) const |
| bool | Remove (const ElementType &Instance, const FBox2D &Box) |
| void | Duplicate (TreeType &OutDuplicate) const |
| void | Empty () |
| void | Serialize (FArchive &Ar) |
| TQuadTree (const TQuadTree &) | |
| TQuadTree & | operator= (const TQuadTree &Other) |
| ~TQuadTree () | |
| TQuadTree< ElementType, NodeCapacity >::TQuadTree | ( | ) |
DO NOT USE. This constructor is for internal usage only for hot-reload purposes.
| TQuadTree< ElementType, NodeCapacity >::TQuadTree | ( | const FBox2D & | InBox, |
| float | InMinimumQuadSize = 100.f |
||
| ) |
| TQuadTree< ElementType, NodeCapacity >::TQuadTree | ( | const TQuadTree< ElementType, NodeCapacity > & | Other | ) |
| TQuadTree< ElementType, NodeCapacity >::~TQuadTree | ( | ) |
| void TQuadTree< ElementType, NodeCapacity >::Duplicate | ( | TreeType & | OutDuplicate | ) | const |
Does a deep copy of the tree by going through and re-creating the internal data. Cheaper than re-insertion as it should be linear instead of nlogn
| void TQuadTree< ElementType, NodeCapacity >::Empty | ( | ) |
Removes all elements of the tree
|
inline |
Given a 2D box, iterates over intersecting elements and execute the callback for each. If Callback returns true, it will continue processing, if it returns false, iteration will end.
| void TQuadTree< ElementType, NodeCapacity >::GetElements | ( | const FBox2D & | Box, |
| TArray< ElementType, ElementAllocatorType > & | ElementsOut | ||
| ) | const |
Given a 2D box, returns an array of elements within the box. There will not be any duplicates in the list.
|
inline |
Gets the TreeBox so systems can test insertions before trying to do so with invalid regions
| void TQuadTree< ElementType, NodeCapacity >::Insert | ( | const ElementType & | Element, |
| const FBox2D & | Box, | ||
| const TCHAR * | DebugContext = nullptr |
||
| ) |
Inserts an object of type ElementType with an associated 2D box of size Box (log n). Pass in a DebugContext so when an issue occurs the log can report what requested this insert.
| TQuadTree< ElementType, NodeCapacity > & TQuadTree< ElementType, NodeCapacity >::operator= | ( | const TQuadTree< ElementType, NodeCapacity > & | Other | ) |
| bool TQuadTree< ElementType, NodeCapacity >::Remove | ( | const ElementType & | Instance, |
| const FBox2D & | Box | ||
| ) |
Removes an object of type ElementType with an associated 2D box of size Box (log n). Does not cleanup tree
| void TQuadTree< ElementType, NodeCapacity >::Serialize | ( | FArchive & | Ar | ) |