19template<
typename InElementType,
typename InAllocator = FDefaultAllocator>
53 NodeBoundingBoxes.Reset();
76 const bool bOverlap =
Box.Intersect(NodeBoundingBoxes[NodeIndex]);
77 const int16 ElementIndex = Nodes[NodeIndex];
78 const bool bLeafNode = (ElementIndex >= 0);
94 bool IsEmpty()
const {
return Nodes.Num() == 0; }
102 int16& NodeIndex = Nodes[CurrentNode];
150 NodeBoundingBoxes.Reset();
176 NodeBoundingBoxes.AddUninitialized(
NodesCount);
182 for (
const FElement& Element : Elements)
210 return (MaxX > MaxY && MaxX > MaxZ)
212 : ((MaxY > MaxZ) ? 1 : 2);
constexpr auto MakeArrayView(OtherRangeType &&Other)
Definition ArrayView.h:873
@ ForceInit
Definition CoreMiscDefines.h:155
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
UE_FORCEINLINE_HINT SizeType AddUninitialized()
Definition Array.h:1664
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void Reset(SizeType NewSize=0)
Definition Array.h:2246
UE_REWRITE void Sort(RangeType &&Range)
Definition Sort.h:16
U16 Index
Definition radfft.cpp:71
int ElementIndex
Definition BVTree.h:27
FElementBox(const FBox &Box)
Definition BVTree.h:32
FElementBox()
Definition BVTree.h:29
static int GetLongestAxis(const FBox &NodeBounds)
Definition BVTree.h:204
void Subdivide(TArray< FElementBox > &ElementBBoxes, const int StartIndex, const int LimitIndex, int &CurrentNode)
Definition BVTree.h:97
void GetOverlapping(const FBox &Box, TArray< FElement > &OutOverlappingElements) const
Definition BVTree.h:69
bool IsEmpty() const
Definition BVTree.h:94
TBVTree(const TArray< FElement > &InElements)
Definition BVTree.h:38
void Create(TArray< FElement > &&InElements)
Definition BVTree.h:162
void Create(const TArray< FElement > &InElements)
Definition BVTree.h:154
void RecreateTree()
Definition BVTree.h:50
void RecreateTree(const TArray< FElement > &InElements)
Definition BVTree.h:57
static FBox CalcElementBounds(const FElement &)
TBVTree()
Definition BVTree.h:36
InElementType FElement
Definition BVTree.h:22
const TArray< FElement > & GetElements() const
Definition BVTree.h:91
void RecreateTree(TArray< FElement > &&InElements)
Definition BVTree.h:63
TArray< FElement > & GetElements()
Definition BVTree.h:92
const TArray< int16, InAllocator > & GetNodes() const
Definition BVTree.h:89
void CreateCommonInternal()
Definition BVTree.h:170
void Reset()
Definition BVTree.h:147
static FBox CalcNodeBounds(const TArray< FElementBox > &ElementBBoxes, const int StartIndex, const int LimitIndex)
Definition BVTree.h:194
TBVTree(TArray< FElement > &&InElements)
Definition BVTree.h:43
const TArray< FBox, InAllocator > & GetBoundingBoxes() const
Definition BVTree.h:90