20#ifndef CHAOS_DEBUG_NAME
21#define CHAOS_DEBUG_NAME 0
151 template<
typename ElementT>
155template<
typename T,
typename TEnableIf<!TModels_V<CIsUpdatableElement, T>>::Type* =
nullptr>
156static void UpdateElementHelper(T&
InElem,
const T&
InFrom)
161template<
typename T,
typename TEnableIf<TModels_V<CIsUpdatableElement, T>>::Type* =
nullptr>
162static void UpdateElementHelper(T&
InElem,
const T&
InFrom)
170template <
typename TQueryFastData, EAABBQueryType Query>
216template <
typename TPayloadType,
typename T,
bool bComputeBounds>
221template <
typename TPayloadType,
typename T>
228 for (
const auto&
Elem : Elems)
230 Bounds.GrowToInclude(
Elem.Bounds);
232 if (!Elems.IsEmpty() && bDynamicTree)
245template <
typename TPayloadType,
typename T>
258template <
typename TPayloadType,
bool bComputeBounds = true,
typename T = FReal>
266 this->ComputeBounds(
Elems,
false);
287 this->ComputeBounds(
Elems, bDynamicTree);
306 template <
typename TSQVisitor,
typename TQueryFastData>
312 template <
typename TSQVisitor,
typename TQueryFastData>
318 template <
typename TSQVisitor,
typename TQueryFastData>
325 template <
typename TSQVisitor>
370 if (Visitor.VisitOverlap(
VisitData) ==
false)
389 if (Visitor.VisitOverlap(
VisitData) ==
false)
399 template <
bool bSweep,
typename TQueryFastData,
typename TSQVisitor>
416 const bool bContinue = (bSweep && Visitor.VisitSweep(
VisitData, QueryFastData)) || (!bSweep && Visitor.VisitRaycast(
VisitData, QueryFastData));
426 template <
typename TQueryFastData,
typename TSQVisitor>
456 if (
Elems[Idx].Payload == Payload)
458 Elems.RemoveAtSwap(Idx);
476 if (
Elems[Idx].Payload == Payload)
479 UpdateElementHelper(
Elems[Idx].Payload, Payload);
490 if (
Elems[Idx].Payload == Payload)
493 UpdateElementHelper(
Elems[Idx].Payload, Payload);
511#if !UE_BUILD_SHIPPING
533 for (
const auto&
Elem : Elems)
536 Elem.Bounds.Min()[0],
Elem.Bounds.Min()[1],
Elem.Bounds.Min()[2],
537 Elem.Bounds.Max()[0],
Elem.Bounds.Max()[1],
Elem.Bounds.Max()[2]);
550 bool bDirtyLeaf =
false;
552 friend ::FChaosVDDataWrapperUtils;
555template <
typename TPayloadType,
bool bComputeBounds,
typename T>
564template<
typename LeafType>
592 return FParent::operator[](
Index);
596 return FParent::operator[](
Index);
600 return NumOfValidElements;
608 for (
int32 ElementIndex = 0; ElementIndex < NumOfValidElements; ElementIndex++)
610 (*this)[ElementIndex].Reset();
612 NumOfValidElements = 0;
616 NumOfValidElements++;
617 if (NumOfValidElements > FParent::Num())
623 (*this)[NumOfValidElements - 1] = Item;
625 return NumOfValidElements - 1;
633 int32 NumOfValidElements = 0;
635 friend ::FChaosVDDataWrapperUtils;
638template <
typename LeafType>
650 : ChildrenBounds{
TAABB<T, 3>() ,
TAABB<T, 3>()}
663#if !UE_BUILD_SHIPPING
671 for (
int ChildIndex = 0; ChildIndex < 2; ++ChildIndex)
673 int32 NodeIndex = ChildrenNodes[ChildIndex];
674 if (NodeIndex > 0 && NodeIndex < Nodes.Num())
679 for (
int ChildIndex = 0; ChildIndex < 2; ++ChildIndex)
689 for (
auto& Bounds : ChildrenBounds)
694 for (
auto& Node : ChildrenNodes)
737 Ar << GlobalPayloadIdx;
738 Ar << DirtyPayloadIdx;
740 Ar << DirtyGridOverflowIdx;
775template<
typename PayloadType>
784template <
typename TPayloadType,
typename TLeafType,
bool bMutable = true,
typename T = FReal,
typename StorageTraits = TDefaultAABBTreeStorageTraits<TPayloadType>>
792 static constexpr int D = 3;
794 static constexpr T DefaultMaxPayloadBounds = 100000;
795 static constexpr int32 DefaultMaxChildrenInLeaf = 12;
796 static constexpr int32 DefaultMaxTreeDepth = 16;
797 static constexpr int32 DefaultMaxNumToProcess = 0;
799 (std::is_same_v<TBoundingVolume<TPayloadType>,
TLeafType> ? ESpatialAcceleration::AABBTreeBV : ESpatialAcceleration::Unknown);
802 , bDynamicTree(
false)
806 , MaxChildrenInLeaf(DefaultMaxChildrenInLeaf)
807 , MaxTreeDepth(DefaultMaxTreeDepth)
808 , MaxPayloadBounds(DefaultMaxPayloadBounds)
809 , MaxNumToProcess(DefaultMaxNumToProcess)
810 , bModifyingTreeMultiThreadingFastCheck(
false)
811 , bShouldRebuild(
true)
812 , bBuildOverlapCache(
true)
816 StorageTraits::InitPayloadToInfo(PayloadToInfo);
823 DirtyElements.Reset();
824 CellHashToFlatArray.Reset();
825 FlattenedCellArrayOfDirtyIndices.Reset();
826 DirtyElementsGridOverflow.Reset();
828 TreeExpensiveStats.Reset();
829 GlobalPayloads.Reset();
830 PayloadToInfo.Reset();
832 OverlappingLeaves.Reset();
833 OverlappingOffsets.Reset();
834 OverlappingPairs.Reset();
835 OverlappingCounts.Reset();
837 NumProcessedThisSlice = 0;
839 StartSliceTimeStamp = 0.0;
840 CurrentDataElementsCopiedSinceLastCheck = 0;
841 CurrentProcessedNodesSinceChecked = 0;
844 WorkPoolFreeList.Reset();
847 bShouldRebuild =
true;
853 this->SetAsyncTimeSlicingComplete(
true);
855 if (DirtyElementTree !=
nullptr)
857 DirtyElementTree->Reset();
868 this->SetAsyncTimeSlicingComplete(
true);
881 NumProcessedThisSlice = 0;
887 template <
typename TParticles>
895 , bModifyingTreeMultiThreadingFastCheck(
false)
896 , bShouldRebuild(
true)
902 DirtyElementTree->SetTreeToDynamic();
905 StorageTraits::InitPayloadToInfo(PayloadToInfo);
907 GenerateTree(Particles);
920 , bModifyingTreeMultiThreadingFastCheck(
false)
921 , bShouldRebuild(
true)
927 DirtyElementTree->SetTreeToDynamic();
930 StorageTraits::InitPayloadToInfo(PayloadToInfo);
933 template <
typename ParticleView>
941 bModifyingTreeMultiThreadingFastCheck =
false;
942 bShouldRebuild =
true;
944 GenerateTree(Particles);
951 if (Nodes[NodeIdx].bLeaf)
958 GetAsBoundsArray(
AllBounds, Nodes[NodeIdx].ChildrenNodes[0], NodeIdx, Nodes[NodeIdx].ChildrenBounds[0]);
959 GetAsBoundsArray(
AllBounds, Nodes[NodeIdx].ChildrenNodes[1], NodeIdx, Nodes[NodeIdx].ChildrenBounds[0]);
982 template <
typename SQVisitor>
989 template <
typename SQVisitor>
1001 template <
typename SQVisitor>
1008 template <
typename SQVisitor>
1020 template <
typename SQVisitor>
1026 template <
typename SQVisitor>
1040 DirtyElementGridCellSizeInv = 1.0f / DirtyElementGridCellSize;
1044 DirtyElementGridCellSizeInv = 1.0f;
1054 return DirtyElementTree ==
nullptr && DirtyElementGridCellSize > 0.0f &&
1055 DirtyElementMaxGridCellQueryCount > 0 &&
1056 DirtyElementMaxPhysicalSizeInCells > 0 &&
1057 DirtyElementMaxCellCapacity > 0;
1065 if (
HashEntry->Count >= DirtyElementMaxCellCapacity)
1081 if (
HashEntry->Count < DirtyElementMaxCellCapacity)
1095 FlattenedCellArrayOfDirtyIndices.AddUninitialized(DirtyElementMaxCellCapacity);
1097 TreeStats.StatNumNonEmptyCellsInGrid++;
1153 ensure(DeleteDirtyParticleIndexFromGridCell(Hash, LastDirtyElementIndex));
1154 ensure(AddNewDirtyParticleIndexToGridCell(Hash, DeleteDirtyParticleIdx));
1176 TreeStats.StatNumElementsTooLargeForGrid++;
1182 if (!EnoughSpaceInGridCell(
Hash))
1234 return DirtyGridOverflowIdx;
1248 for(
int LeafIndex = 0; LeafIndex < Leaves.Num(); LeafIndex++)
1251 Leaf.GatherElements(AllElements);
1255 int32 DepthTotal = 0;
1256 for(
const FElement& Element : AllElements)
1270 Node = Nodes[Node].ParentNode;
1276 if(
Depth > MaxDepth)
1280 DepthTotal +=
Depth;
1283 return { AllElements, DepthTotal, MaxDepth, DirtyElements.Num() };
1299#if !UE_BUILD_SHIPPING
1326 if(DirtyElementTree)
1330 DirtyElementTree->DumpStatsTo(Ar);
1341 FirstFreeInternalNode = Nodes[FirstFreeInternalNode].ChildrenNodes[1];
1369 FirstFreeLeafNode = Nodes[FirstFreeLeafNode].ChildrenNodes[1];
1373 Leaves[LeafIndex].RecomputeBounds(bDynamicTree);
1377 LeafIndex = Leaves.Num();
1406 Nodes[NodeIdx].ChildrenNodes[1] = FirstFreeInternalNode;
1407 FirstFreeInternalNode = NodeIdx;
1417 Leaves[Nodes[NodeIdx].ChildrenNodes[0]].Reset();
1419 Nodes[NodeIdx].ChildrenNodes[1] = FirstFreeLeafNode;
1420 FirstFreeLeafNode = NodeIdx;
1433 if (Nodes[
ParentIdx].ChildrenNodes[0] == NodeIdx)
1450 return(WhichChildAmI(NodeIdx) ^ 1);
1478 PriorityQ.Emplace(
RNode, RootNode, 0.0f);
1480 while (PriorityQ.Num() -
QIndex)
1531 PriorityQ.Reserve(PriorityQ.Num() + 2);
1549 check(!Nodes[NodeIdx].bLeaf);
1651 Leaves[LeafIdx].RecomputeBounds(bDynamicTree);
1751 if (Leaves[LeafIdx].GetElementCount() > 1)
1753 Leaves[LeafIdx].RemoveElement(Payload);
1754 Leaves[LeafIdx].RecomputeBounds(bDynamicTree);
1763 Leaves[LeafIdx].RemoveElement(Payload);
1802 if (
UNLIKELY(!
ensure(bModifyingTreeMultiThreadingFastCheck ==
false)))
1806 bModifyingTreeMultiThreadingFastCheck =
true;
1816 if (
PayloadInfo->GlobalPayloadIdx + 1 < GlobalPayloads.Num())
1821 GlobalPayloads.RemoveAtSwap(
PayloadInfo->GlobalPayloadIdx);
1825 if (DirtyElementTree !=
nullptr)
1827 DirtyElementTree->RemoveLeafNode(
PayloadInfo->DirtyPayloadIdx, Payload);
1829 else if (DirtyElementGridEnabled())
1835 if (
PayloadInfo->DirtyPayloadIdx + 1 < DirtyElements.Num())
1840 DirtyElements.RemoveAtSwap(
PayloadInfo->DirtyPayloadIdx);
1851 Leaves[
PayloadInfo->LeafIdx].RemoveElement(Payload);
1855 PayloadToInfo.Remove(Payload);
1856 bShouldRebuild =
true;
1857 bModifyingTreeMultiThreadingFastCheck =
false;
1861 bModifyingTreeMultiThreadingFastCheck =
false;
1891 if (
UNLIKELY(!
ensure(bModifyingTreeMultiThreadingFastCheck ==
false)))
1895 bModifyingTreeMultiThreadingFastCheck =
true;
1909 if constexpr (std::is_same_v<TPayloadType, FAccelerationStructureHandle>)
1915 DebugName = Particle->DebugName();
1920 if (
const FGeometryParticle* Particle = Payload.GetExternalGeometryParticle_ExternalThread())
1922 DebugName = Particle->DebugName();
1929 , DebugName.
IsValid() ? **DebugName :
TEXT(
"<Unknown>"));
1951 bModifyingTreeMultiThreadingFastCheck =
false;
1962 bModifyingTreeMultiThreadingFastCheck =
false;
1978 Leaves[
PayloadInfo->LeafIdx].RemoveElement(Payload);
1989 bShouldRebuild =
true;
1994 if (
NewBounds.Extents().Max() > MaxPayloadBounds)
2013 if (DirtyElementTree)
2022 if (DirtyElementGridEnabled())
2032 if (DirtyElementTree)
2041 DirtyElementTree->Leaves[
DirtyLeafIndex].RecomputeBounds(bDynamicTree);
2052 if (DirtyElementGridEnabled())
2065 if (
PayloadInfo->GlobalPayloadIdx + 1 < GlobalPayloads.Num())
2070 GlobalPayloads.RemoveAtSwap(
PayloadInfo->GlobalPayloadIdx);
2085 UpdateElementHelper(GlobalPayloads[
PayloadInfo->GlobalPayloadIdx].Payload, Payload);
2091 if (DirtyElementTree)
2093 DirtyElementTree->RemoveLeafNode(
PayloadInfo->DirtyPayloadIdx, Payload);
2097 if (DirtyElementGridEnabled())
2103 if (
PayloadInfo->DirtyPayloadIdx + 1 < DirtyElements.Num())
2108 DirtyElements.RemoveAtSwap(
PayloadInfo->DirtyPayloadIdx);
2118 if(!DirtyElementTree && !bDynamicTree && DirtyElements.Num() >
MaxDirtyElements)
2123 bModifyingTreeMultiThreadingFastCheck =
false;
2129 return DirtyElements.Num();
2137 TreeStats.StatNumGridOverflowElements = DirtyElementsGridOverflow.Num();
2144 TreeExpensiveStats.StatMaxNumLeaves = Leaves.Num();
2145 int32 StatMaxLeafSize = 0;
2146 for (
int LeafIndex = 0; LeafIndex < Leaves.Num(); LeafIndex++)
2150 StatMaxLeafSize = FMath::Max(StatMaxLeafSize, (
int32)
Leaf.GetElementCount());
2152 TreeExpensiveStats.StatMaxLeafSize = StatMaxLeafSize;
2153 TreeExpensiveStats.StatMaxTreeDepth = (Nodes.Num() == 0) ? 0 : GetSubtreeDepth(0);
2154 TreeExpensiveStats.StatGlobalPayloadsSize = GlobalPayloads.Num();
2156 return TreeExpensiveStats;
2161 const FNode& Node = Nodes[NodeIdx];
2174 return GlobalPayloads;
2188 check(
InFrom.GetType() == ESpatialAcceleration::AABBTree);
2197 DirtyElementGridCellSize = From.DirtyElementGridCellSize;
2198 DirtyElementGridCellSizeInv = From.DirtyElementGridCellSizeInv;
2199 DirtyElementMaxGridCellQueryCount = From.DirtyElementMaxGridCellQueryCount;
2200 DirtyElementMaxPhysicalSizeInCells = From.DirtyElementMaxPhysicalSizeInCells;
2201 DirtyElementMaxCellCapacity = From.DirtyElementMaxCellCapacity;
2203 MaxChildrenInLeaf = From.MaxChildrenInLeaf;
2204 MaxTreeDepth = From.MaxTreeDepth;
2205 MaxPayloadBounds = From.MaxPayloadBounds;
2206 MaxNumToProcess = From.MaxNumToProcess;
2207 NumProcessedThisSlice = From.NumProcessedThisSlice;
2209 StartSliceTimeStamp = From.StartSliceTimeStamp;
2211 bShouldRebuild = From.bShouldRebuild;
2213 RootNode = From.RootNode;
2214 FirstFreeInternalNode = From.FirstFreeInternalNode;
2215 FirstFreeLeafNode = From.FirstFreeLeafNode;
2219 Nodes.Reserve(From.Nodes.
Num());
2220 Leaves.Reserve(From.Leaves.
Num());
2221 DirtyElements.Reserve(From.DirtyElements.
Num());
2222 CellHashToFlatArray.Reserve(From.CellHashToFlatArray.Num());
2223 FlattenedCellArrayOfDirtyIndices.Reserve(From.FlattenedCellArrayOfDirtyIndices.
Num());
2224 DirtyElementsGridOverflow.Reserve(From.DirtyElementsGridOverflow.
Num());
2225 GlobalPayloads.Reserve(From.GlobalPayloads.
Num());
2226 PayloadToInfo.Reserve(From.PayloadToInfo.Num());
2227 OverlappingLeaves.Reserve(From.OverlappingLeaves.
Num());
2228 OverlappingOffsets.Reserve(From.OverlappingOffsets.
Num());
2229 OverlappingPairs.Reserve(From.OverlappingPairs.
Num());
2230 OverlappingCounts.Reserve(From.OverlappingCounts.
Num());
2232 this->SetAsyncTimeSlicingComplete(
false);
2234 if (From.DirtyElementTree)
2236 if (!DirtyElementTree)
2240 DirtyElementTree->PrepareCopyTimeSliced(*(From.DirtyElementTree));
2244 DirtyElementTree =
nullptr;
2251 check(
InFrom.GetType() == ESpatialAcceleration::AABBTree);
2255 check(From.CellHashToFlatArray.Num() == 0);
2270 CurrentDataElementsCopiedSinceLastCheck++;
2273 CurrentDataElementsCopiedSinceLastCheck = 0;
2297 StartSliceTimeStamp = 0.0;
2352 if (DirtyElementTree)
2354 check(From.DirtyElementTree);
2355 DirtyElementTree->ProgressCopyTimeSliced(*(From.DirtyElementTree),
MaximumBytesToCopy);
2356 if (!DirtyElementTree->IsAsyncTimeSlicingComplete())
2362 this->SetAsyncTimeSlicingComplete(
true);
2371 for (
int32 i = 0; i < 3; ++i)
2404 Ar << DirtyElements;
2405 Ar << GlobalPayloads;
2419 Ar << PayloadToInfo;
2423 PayloadToInfo.Empty();
2427 Ar << MaxChildrenInLeaf;
2429 Ar << MaxPayloadBounds;
2434 DirtyElementGridCellSize = 0.0f;
2435 DirtyElementGridCellSizeInv = 1.0f;
2436 bShouldRebuild =
true;
2442 bModifyingTreeMultiThreadingFastCheck =
false;
2443 bDynamicTree =
false;
2444 bBuildOverlapCache =
true;
2451 ensure(bDynamicTree ==
false);
2468 while (NodeStack.
Num())
2471 const FNode& Node = Nodes[NodeIndex];
2484 for(
int32 ChildIndex = 0; ChildIndex < 2; ++ChildIndex)
2522 else if(LeftNode.
bLeaf)
2547 AddNodesOverlappingLeaves(Nodes[
TreeNode.ChildrenNodes[0]],
TreeNode.ChildrenBounds[0],
2558 if(!Leaves[LeafIndex].IsLeafDirty())
2576 OverlappingPairs.Add(
FIntVector2(LeafIndex, LeafIndex));
2585 for(
int32 NodeIndex = 0, NumNodes = Nodes.Num(); NodeIndex < NumNodes; ++NodeIndex)
2587 if(Nodes[NodeIndex].bLeaf)
2589 Nodes[NodeIndex].bDirtyNode = Leaves[Nodes[NodeIndex].ChildrenNodes[0]].IsLeafDirty();
2590 if(Nodes[NodeIndex].bDirtyNode)
2606 if(!bDynamicTree || (bDynamicTree && RootNode ==
INDEX_NONE))
return;
2610 OverlappingPairs.Reset();
2614 FillPersistentOverlappingPairs();
2615 PropagateLeavesDirtyFlag();
2622 OverlappingPairs.Add(
FIntVector2(LeafIndex, LeafIndex));
2623 OverlappingCounts[LeafIndex] = 1;
2626 AddRootOverlappingLeaves(Nodes[RootNode],
bDirtyFilter);
2628 OverlappingOffsets[0] = 0;
2631 OverlappingOffsets[LeafIndex+1] = OverlappingOffsets[LeafIndex] + OverlappingCounts[LeafIndex];
2632 OverlappingCounts[LeafIndex] = OverlappingOffsets[LeafIndex];
2651 Leaves[LeafIndex].SetDirtyState(
false);
2653 for(
int32 NodeIndex = 0, NumNodes = Nodes.Num(); NodeIndex < NumNodes; ++NodeIndex)
2655 Nodes[NodeIndex].bDirtyNode =
false;
2664 OverlappingLeaves.Reset();
2666 if(!bDynamicTree || (bDynamicTree && RootNode ==
INDEX_NONE))
return;
2673 OverlappingOffsets[LeafIndex] = OverlappingLeaves.
Num();
2674 FindOverlappingLeaf(
FirstNode, LeafIndex, NodeStack);
2676 OverlappingOffsets.Last() = OverlappingLeaves.Num();
2682 if (!bBuildOverlapCache)
2698 ComputeOverlappingCacheFromLeaf();
2708 auto&
Leaf = Leaves[LeafIndex];
2709 UE_LOG(
LogChaos,
Log,
TEXT(
"Overlapping Count[%d] = %d with bounds = %f %f %f | %f %f %f"), LeafIndex,
2710 OverlappingOffsets[LeafIndex+1] - OverlappingOffsets[LeafIndex],
Leaf.GetBounds().Min()[0],
2711 Leaf.GetBounds().Min()[1],
Leaf.GetBounds().Min()[2],
Leaf.GetBounds().Max()[0],
Leaf.GetBounds().Max()[1],
Leaf.GetBounds().Max()[2]);
2725 void ReoptimizeTree()
2727 check(!DirtyElementTree && !bDynamicTree);
2732 for (
int LeafIndex = 0; LeafIndex < Leaves.Num(); LeafIndex++)
2740 AllElements.
Append(DirtyElements);
2741 AllElements.
Append(GlobalPayloads);
2743 for (
int LeafIndex = 0; LeafIndex < Leaves.Num(); LeafIndex++)
2746 Leaf.GatherElements(AllElements);
2749 TAABBTree
NewTree(AllElements);
2751 bShouldRebuild =
true;
2756 template <
typename FunctionType>
2821 const auto&
Elem = DirtyElements[
Index];
2838 template <EAABBQueryType Query,
typename SQVisitor>
2844 if (
Query == EAABBQueryType::Overlap &&
Visitor.GetQueryPayload())
2847 const TPayloadType&
QueryPayload = *
static_cast<const TPayloadType*
>(
Visitor.GetQueryPayload());
2851 if(LeafIndex !=
INDEX_NONE && LeafIndex < (OverlappingOffsets.Num()-1))
2871 template <EAABBQueryType Query,
typename TQueryFastData,
typename SQVisitor>
2885 for(
const auto&
Elem : GlobalPayloads)
2897 if(
Query == EAABBQueryType::Overlap)
2913 if (DirtyElementTree)
2934 if constexpr (
Query == EAABBQueryType::Overlap)
2952 if (DirtyElements.Num() > 0)
2954 bool bUseGrid =
false;
2956 if (DirtyElementGridEnabled() && CellHashToFlatArray.Num() > 0)
2958 if constexpr (
Query == EAABBQueryType::Overlap)
2962 else if constexpr (
Query == EAABBQueryType::Raycast)
2966 else if constexpr (
Query == EAABBQueryType::Sweep)
2987 if constexpr (
Query == EAABBQueryType::Overlap)
2991 else if constexpr (
Query == EAABBQueryType::Raycast)
2995 else if constexpr (
Query == EAABBQueryType::Sweep)
2998 [&](FReal
X, FReal
Y)
3000 int32 QueryCellHash = HashCoordinates(X, Y, DirtyElementGridCellSizeInv);
3001 const DirtyGridHashEntry* HashEntry = CellHashToFlatArray.Find(QueryCellHash);
3004 HashEntryForOverlappedCells.Add(*HashEntry);
3018 for (
const auto&
Elem : DirtyElements)
3036 if (bDynamicTree && !OverlappingLeaves.IsEmpty())
3057 else if (Nodes.Num())
3078 if constexpr (
Query == EAABBQueryType::Raycast)
3087 while (NodeStack.
Num())
3098 if constexpr (
Query != EAABBQueryType::Overlap)
3106 const FNode& Node = Nodes[
NodeEntry.NodeIdx];
3110 const auto&
Leaf =
Leaves[Node.ChildrenNodes[0]];
3111 if constexpr (
Query == EAABBQueryType::Overlap)
3118 else if constexpr (
Query == EAABBQueryType::Sweep)
3135 if constexpr (
Query != EAABBQueryType::Overlap)
3139 if constexpr (
Query == EAABBQueryType::Raycast)
3152 FAABB3 AABB0(Node.ChildrenBounds[0].Min(), Node.ChildrenBounds[0].Max());
3155 FAABB3 AABB1(Node.ChildrenBounds[1].Min(), Node.ChildrenBounds[1].Max());
3182 for (
const TAABB<T, 3>&AABB : Node.ChildrenBounds)
3184 if (TAABBTreeIntersectionHelper<TQueryFastData, Query>::Intersects(Start,
CurData, TOI,
FAABB3(AABB.Min(), AABB.Max()),
QueryBounds,
QueryHalfExtents, Dir, InvDir, bParallel))
3197 int32 GetNewWorkSnapshot()
3199 if(WorkPoolFreeList.Num())
3201 return WorkPoolFreeList.Pop();
3205 return WorkPool.AddDefaulted(1);
3209 void FreeWorkSnapshot(
int32 WorkSnapshotIdx)
3212 WorkPool[WorkSnapshotIdx] = FWorkSnapshot();
3213 WorkPoolFreeList.Add(WorkSnapshotIdx);
3217 template <
typename TParticles>
3218 void GenerateTree(
const TParticles& Particles)
3221 this->SetAsyncTimeSlicingComplete(
false);
3223 ensure(WorkStack.Num() == 0);
3225 int32 NumParticles = 0;
3229 NumParticles = Particles.Num();
3237 const int32 CurIdx = GetNewWorkSnapshot();
3242 GlobalPayloads.Reset();
3248 DirtyElements.Reset();
3249 CellHashToFlatArray.Reset();
3250 FlattenedCellArrayOfDirtyIndices.Reset();
3251 DirtyElementsGridOverflow.Reset();
3252 if (DirtyElementTree)
3254 DirtyElementTree->Reset();
3258 TreeExpensiveStats.Reset();
3259 PayloadToInfo.Reset();
3260 NumProcessedThisSlice = 0;
3271 for (
auto& Particle : Particles)
3277 UpdateElement(Payload,
ElemBounds, bHasBoundingBox);
3281 this->SetAsyncTimeSlicingComplete(
true);
3301 for (
auto& Particle : Particles)
3308 if (bHasBoundingBox && ValidateBounds(
ElemBounds) ==
false)
3310 bHasBoundingBox =
false;
3311 ensureMsgf(
false,
TEXT(
"AABBTree encountered invalid bounds input. Forcing element to global payload. Min: %s Max: %s."),
3316 if (bHasBoundingBox)
3318 if (
ElemBounds.Extents().Max() > MaxPayloadBounds)
3320 bHasBoundingBox =
false;
3338 if (!bHasBoundingBox)
3344 GlobalPayloads.Add(FElement{ Payload,
ElemBounds });
3353 NumProcessedThisSlice = NumParticles;
3361 WorkStack.Add(CurIdx);
3395 enum eTimeSlicePhase
3398 DuringFindBestBounds,
3404 TAABB<T, 3> RealBounds;
3405 int32 WorkSnapshotIdx;
3408 struct FWorkSnapshot
3411 : TimeslicePhase(eTimeSlicePhase::PreFindBestBounds)
3416 eTimeSlicePhase TimeslicePhase;
3428 int32 BestBoundsCurIdx;
3430 FSplitInfo SplitInfos[2];
3433 int32 GetLastIndexToProcess(
int32 CurrentIndex)
3468 CurrentProcessedNodesSinceChecked++;
3471 CurrentProcessedNodesSinceChecked = 0;
3507 const FElement&
Elem = CurrentSnapshot.Elems[
ElemIdx];
3519 else if(MaxAxis == 2)
3551 while (WorkStack.Num())
3554 const int32 CurIdx = WorkStack.Last();
3556 if (WorkPool[CurIdx].TimeslicePhase == eTimeSlicePhase::ProcessingChildren)
3560 FreeWorkSnapshot(CurIdx);
3564 const int32 NewNodeIdx = WorkPool[CurIdx].NewNodeIdx;
3567 if (NewNodeIdx >= Nodes.Num())
3569 Nodes.AddDefaulted((1 + NewNodeIdx) - Nodes.Num());
3572 if (!CanContinueProcessingNodes())
3590 PayloadToInfoRef.Add(
Elem.Payload, FAABBTreePayloadInfo{ INDEX_NONE, INDEX_NONE, LeavesRef.Num() });
3598 if (WorkPool[CurIdx].Elems.Num() <= MaxChildrenInLeaf || WorkPool[CurIdx].NodeLevel >= MaxTreeDepth)
3603 FreeWorkSnapshot(CurIdx);
3607 if (WorkPool[CurIdx].TimeslicePhase == eTimeSlicePhase::PreFindBestBounds)
3614 WorkPool[CurIdx].SplitInfos[0].WorkSnapshotIdx =
FirstChildIdx;
3617 for (FSplitInfo&
SplitInfo : WorkPool[CurIdx].SplitInfos)
3622 WorkPool[CurIdx].BestBoundsCurIdx = 0;
3623 WorkPool[CurIdx].TimeslicePhase = eTimeSlicePhase::DuringFindBestBounds;
3636 if (!CanContinueProcessingNodes())
3643 if (WorkPool[CurIdx].TimeslicePhase == eTimeSlicePhase::DuringFindBestBounds)
3651 (WorkPool[CurIdx].ScaledCenterVariance[0] > WorkPool[CurIdx].ScaledCenterVariance[1] ?
3652 (WorkPool[CurIdx].ScaledCenterVariance[0] > WorkPool[CurIdx].ScaledCenterVariance[2] ? 0 : 2) :
3653 (WorkPool[CurIdx].ScaledCenterVariance[1] > WorkPool[CurIdx].ScaledCenterVariance[2] ? 1 : 2));
3662 if (!CanContinueProcessingNodes())
3677 Nodes[NewNodeIdx].bLeaf =
false;
3679 Nodes[NewNodeIdx].ChildrenBounds[0] = WorkPool[CurIdx].SplitInfos[0].RealBounds;
3680 WorkPool[
FirstChildIdx].Bounds = Nodes[NewNodeIdx].ChildrenBounds[0];
3681 Nodes[NewNodeIdx].ChildrenNodes[0] = Nodes.Num();
3683 Nodes[NewNodeIdx].ChildrenBounds[1] = WorkPool[CurIdx].SplitInfos[1].RealBounds;
3684 WorkPool[
SecondChildIdx].Bounds = Nodes[NewNodeIdx].ChildrenBounds[1];
3685 Nodes[NewNodeIdx].ChildrenNodes[1] = Nodes.Num() + 1;
3687 WorkPool[
FirstChildIdx].NodeLevel = WorkPool[CurIdx].NodeLevel + 1;
3688 WorkPool[
SecondChildIdx].NodeLevel = WorkPool[CurIdx].NodeLevel + 1;
3690 WorkPool[
FirstChildIdx].NewNodeIdx = Nodes[NewNodeIdx].ChildrenNodes[0];
3691 WorkPool[
SecondChildIdx].NewNodeIdx = Nodes[NewNodeIdx].ChildrenNodes[1];
3701 WorkPool[CurIdx].TimeslicePhase = eTimeSlicePhase::ProcessingChildren;
3708 FreeWorkSnapshot(CurIdx);
3712 check(WorkStack.Num() == 0);
3715 this->SetAsyncTimeSlicingComplete(
true);
3725 CollectedResults.Add(
Instance.Payload);
3739 const void* GetQueryData()
const {
return nullptr; }
3740 const void* GetSimData()
const {
return nullptr; }
3743 const void* GetQueryPayload()
const
3748 bool HasBlockingHit()
const
3759 Overlap(Intersection, Collector);
3766 template<
typename ContainerType>
3769 if constexpr (std::is_same_v<ContainerType, TArrayAsMap<TPayloadType, FAABBTreePayloadInfo>>)
3773 else if constexpr(std::is_same_v<ContainerType, TSQMap<TPayloadType, FAABBTreePayloadInfo>>)
3783 template<
typename ContainerType>
3786 if constexpr (std::is_same_v<ContainerType, TArray<TAABBTreeLeafArray<TPayloadType, true>>>)
3790 else if constexpr (std::is_same_v<ContainerType, TArray<TAABBTreeLeafArray<TPayloadType, false>>>)
3796 return sizeof(
typename ContainerType::ElementType);
3800 template<
typename ContainerType,
typename TCanContinueCallback>
3829#if !UE_BUILD_SHIPPING
3834 int32 RootNodeIndex = bDynamicTree ? RootNode : 0;
3835 if (Nodes.Num() > 0 && Nodes.IsValidIndex(RootNodeIndex))
3837 Nodes[RootNodeIndex].DebugDraw(*
InInterface, Nodes, { 1.f, 1.f, 1.f }, 5.f);
3839 for (
int LeafIndex = 0; LeafIndex <
Leaves.Num(); LeafIndex++)
3849 TAABBTree(
const TAABBTree&
Other)
3850 : ISpatialAcceleration<TPayloadType, T, 3>(StaticType)
3851 , Nodes(
Other.Nodes)
3853 , DirtyElements(
Other.DirtyElements)
3854 , bDynamicTree(
Other.bDynamicTree)
3855 , RootNode(
Other.RootNode)
3856 , FirstFreeInternalNode(
Other.FirstFreeInternalNode)
3857 , FirstFreeLeafNode(
Other.FirstFreeLeafNode)
3858 , CellHashToFlatArray(
Other.CellHashToFlatArray)
3859 , FlattenedCellArrayOfDirtyIndices(
Other.FlattenedCellArrayOfDirtyIndices)
3860 , DirtyElementsGridOverflow(
Other.DirtyElementsGridOverflow)
3861 , DirtyElementTree(nullptr)
3862 , DirtyElementGridCellSize(
Other.DirtyElementGridCellSize)
3863 , DirtyElementGridCellSizeInv(
Other.DirtyElementGridCellSizeInv)
3864 , DirtyElementMaxGridCellQueryCount(
Other.DirtyElementMaxGridCellQueryCount)
3865 , DirtyElementMaxPhysicalSizeInCells(
Other.DirtyElementMaxPhysicalSizeInCells)
3866 , DirtyElementMaxCellCapacity(
Other.DirtyElementMaxCellCapacity)
3867 , TreeStats(
Other.TreeStats)
3868 , TreeExpensiveStats(
Other.TreeExpensiveStats)
3869 , GlobalPayloads(
Other.GlobalPayloads)
3870 , PayloadToInfo(
Other.PayloadToInfo)
3871 , MaxChildrenInLeaf(
Other.MaxChildrenInLeaf)
3872 , MaxTreeDepth(
Other.MaxTreeDepth)
3873 , MaxPayloadBounds(
Other.MaxPayloadBounds)
3874 , MaxNumToProcess(
Other.MaxNumToProcess)
3875 , NumProcessedThisSlice(
Other.NumProcessedThisSlice)
3876 , StartSliceTimeStamp(
Other.StartSliceTimeStamp)
3877 , bModifyingTreeMultiThreadingFastCheck(
Other.bModifyingTreeMultiThreadingFastCheck)
3878 , bShouldRebuild(
Other.bShouldRebuild)
3879 , bBuildOverlapCache(
Other.bBuildOverlapCache)
3880 , OverlappingLeaves(
Other.OverlappingLeaves)
3881 , OverlappingOffsets(
Other.OverlappingOffsets)
3882 , OverlappingPairs(
Other.OverlappingPairs)
3883 , OverlappingCounts(
Other.OverlappingCounts)
3886 PriorityQ.Reserve(32);
3887 if (
Other.DirtyElementTree)
3895 check(
Other.GetType() == ESpatialAcceleration::AABBTree);
3896 *
this =
static_cast<const TAABBTree&
>(
Other);
3899 TAABBTree& operator=(
const TAABBTree& Rhs)
3901 ISpatialAcceleration<TPayloadType, T, 3>::DeepAssign(Rhs);
3907 WorkPoolFreeList.Empty();
3912 DirtyElements =
Rhs.DirtyElements;
3913 bDynamicTree =
Rhs.bDynamicTree;
3914 RootNode =
Rhs.RootNode;
3915 FirstFreeInternalNode =
Rhs.FirstFreeInternalNode;
3916 FirstFreeLeafNode =
Rhs.FirstFreeLeafNode;
3918 CellHashToFlatArray =
Rhs.CellHashToFlatArray;
3919 FlattenedCellArrayOfDirtyIndices =
Rhs.FlattenedCellArrayOfDirtyIndices;
3920 DirtyElementsGridOverflow =
Rhs.DirtyElementsGridOverflow;
3921 TreeStats =
Rhs.TreeStats;
3922 TreeExpensiveStats =
Rhs.TreeExpensiveStats;
3924 DirtyElementGridCellSize =
Rhs.DirtyElementGridCellSize;
3925 DirtyElementGridCellSizeInv =
Rhs.DirtyElementGridCellSizeInv;
3926 DirtyElementMaxGridCellQueryCount =
Rhs.DirtyElementMaxGridCellQueryCount;
3927 DirtyElementMaxPhysicalSizeInCells =
Rhs.DirtyElementMaxPhysicalSizeInCells;
3928 DirtyElementMaxCellCapacity =
Rhs.DirtyElementMaxCellCapacity;
3930 GlobalPayloads =
Rhs.GlobalPayloads;
3931 PayloadToInfo =
Rhs.PayloadToInfo;
3932 MaxChildrenInLeaf =
Rhs.MaxChildrenInLeaf;
3933 MaxTreeDepth =
Rhs.MaxTreeDepth;
3934 MaxPayloadBounds =
Rhs.MaxPayloadBounds;
3935 MaxNumToProcess =
Rhs.MaxNumToProcess;
3936 NumProcessedThisSlice =
Rhs.NumProcessedThisSlice;
3937 StartSliceTimeStamp =
Rhs.StartSliceTimeStamp;
3938 bModifyingTreeMultiThreadingFastCheck =
Rhs.bModifyingTreeMultiThreadingFastCheck;
3939 bShouldRebuild =
Rhs.bShouldRebuild;
3940 bBuildOverlapCache =
Rhs.bBuildOverlapCache;
3941 if (
Rhs.DirtyElementTree)
3943 if (!DirtyElementTree)
3947 *DirtyElementTree = *
Rhs.DirtyElementTree;
3951 DirtyElementTree =
nullptr;
3959 TLeafContainer<TLeafType>
Leaves;
3963 bool bDynamicTree =
false;
3978 T DirtyElementGridCellSize;
3979 T DirtyElementGridCellSizeInv;
3980 int32 DirtyElementMaxGridCellQueryCount;
3981 int32 DirtyElementMaxPhysicalSizeInCells;
3982 int32 DirtyElementMaxCellCapacity;
3984 AABBTreeStatistics TreeStats;
3985 AABBTreeExpensiveStatistics TreeExpensiveStats;
3988 typename StorageTraits::PayloadToInfoType PayloadToInfo;
3990 int32 MaxChildrenInLeaf;
3993 int32 MaxNumToProcess;
3994 int32 NumProcessedThisSlice;
3996 double StartSliceTimeStamp = 0.0;
3997 int32 CurrentProcessedNodesSinceChecked = 0;
3998 int32 CurrentDataElementsCopiedSinceLastCheck = 0;
4004 bool bModifyingTreeMultiThreadingFastCheck;
4006 bool bShouldRebuild;
4008 bool bBuildOverlapCache;
4028 friend ::FChaosVDDataWrapperUtils;
4031template<
typename TPayloadType,
typename TLeafType,
bool bMutable,
typename T,
typename StorageTraits>
#define check(expr)
Definition AssertionMacros.h:314
#define ensureMsgf( InExpression, InFormat,...)
Definition AssertionMacros.h:465
#define ensure( InExpression)
Definition AssertionMacros.h:464
#define PHYSICS_CSV_CUSTOM_VERY_EXPENSIVE(Category, Name, Value, Op)
Definition ChaosStats.h:164
#define PHYSICS_CSV_SCOPED_VERY_EXPENSIVE(Category, Name)
Definition ChaosStats.h:163
#define GLog
Definition CoreGlobals.h:95
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define FORCEINLINE_DEBUGGABLE
Definition CoreMiscDefines.h:74
#define DECLARE_CYCLE_STAT(CounterName, StatId, GroupId)
Definition Stats.h:669
#define SCOPE_CYCLE_COUNTER(Stat)
Definition Stats.h:650
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define TRACE_CPUPROFILER_EVENT_SCOPE(Name)
Definition CpuProfilerTrace.h:528
#define CSV_DECLARE_CATEGORY_EXTERN(CategoryName)
Definition CsvProfiler.h:79
#define CSV_CUSTOM_STAT(Category, StatName, Value, Op)
Definition CsvProfiler.h:160
FArchive & operator<<(FArchive &Ar, FEnvQueryDebugProfileData::FStep &Data)
Definition EnvQueryTypes.cpp:489
return true
Definition ExternalRpcRegistry.cpp:601
#define UE_LOG(CategoryName, Verbosity, Format,...)
Definition LogMacros.h:270
UE::Math::TIntVector2< int32 > FIntVector2
Definition MathFwd.h:91
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
FORCEINLINE VectorRegister4Float VectorDivide(const VectorRegister4Float &Vec1, const VectorRegister4Float &Vec2)
Definition UnrealMathFPU.h:834
FORCEINLINE VectorRegister4Float VectorCompareGT(const VectorRegister4Float &Vec1, const VectorRegister4Float &Vec2)
Definition UnrealMathFPU.h:974
FORCEINLINE VectorRegister4Double MakeVectorRegisterDouble(uint64 X, uint64 Y, uint64 Z, uint64 W)
Definition UnrealMathFPU.h:185
FORCEINLINE int32 VectorMaskBits(const VectorRegister4Float &Vec1)
Definition UnrealMathFPU.h:1075
FORCEINLINE VectorRegister4Float VectorAbs(const VectorRegister4Float &Vec)
Definition UnrealMathFPU.h:661
FORCEINLINE VectorRegister4Float VectorBitwiseOr(const VectorRegister4Float &Vec1, const VectorRegister4Float &Vec2)
Definition UnrealMathFPU.h:1140
#define UE_SMALL_NUMBER
Definition UnrealMathUtility.h:130
FORCEINLINE void VectorStoreDouble1(VectorRegister4Double Vec, double *Ptr)
Definition UnrealMathVectorCommon.h.inl:830
FORCEINLINE VectorRegister4Float VectorOne(void)
Definition UnrealMathVectorCommon.h.inl:21
FORCEINLINE VectorRegister4Double VectorSetDouble1(double D)
Definition UnrealMathVectorCommon.h.inl:820
FORCEINLINE VectorRegister4Double VectorLoadDouble3(const double *Ptr)
Definition UnrealMathVectorCommon.h.inl:113
FORCEINLINE VectorRegister4Float VectorBitwiseNotAnd(const VectorRegister4Float &A, const VectorRegister4Float &B)
Definition VectorUtility.h:289
Definition AABBVectorizedDouble.h:15
Definition ParticleHandle.h:213
Definition ChaosArchive.h:167
Definition ISpatialAcceleration.h:166
Definition ISpatialAcceleration.h:267
Definition ISpatialAcceleration.h:120
Definition AABBTree.h:786
void DumpStatsTo(FOutputDevice &Ar) const override
Definition AABBTree.h:1308
virtual bool IsTreeDynamic() const override
Definition AABBTree.h:2182
FORCEINLINE_DEBUGGABLE bool DirtyElementGridEnabled() const
Definition AABBTree.h:1052
void DeAllocateInternalNode(int32 NodeIdx)
Definition AABBTree.h:1404
virtual ~TAABBTree()
Definition AABBTree.h:964
void RemoveLeafNode(int32 LeafNodeIdx, const TPayloadType &Payload)
Definition AABBTree.h:1741
void GetCVars()
Definition AABBTree.h:1035
TAABBTree(EmptyInit, int32 InMaxChildrenInLeaf=DefaultMaxChildrenInLeaf, int32 InMaxTreeDepth=DefaultMaxTreeDepth, T InMaxPayloadBounds=DefaultMaxPayloadBounds, int32 InMaxNumToProcess=DefaultMaxNumToProcess, bool bInDynamicTree=false, bool bInUseDirtyTree=false, bool bInBuildOverlapCache=true)
Definition AABBTree.h:913
const int32 GetSubtreeDepth(const int32 NodeIdx)
Definition AABBTree.h:2159
int32 NumDirtyElements() const
Definition AABBTree.h:2127
int32 FindBestSibling(const TAABB< T, 3 > &InNewBounds, bool &bOutAddToLeaf)
Definition AABBTree.h:1454
const AABBTreeStatistics & GetAABBTreeStatistics()
Definition AABBTree.h:2133
virtual void ProgressAsyncTimeSlicing(bool ForceBuildCompletion) override
Definition AABBTree.h:861
FORCEINLINE_DEBUGGABLE bool DeleteDirtyParticleIndexFromGridCell(int32 Hash, int32 DirtyIndex)
Definition AABBTree.h:1104
FORCEINLINE_DEBUGGABLE int32 UpdateDirtyElementInGrid(const TAABB< T, 3 > &NewBounds, int32 DirtyElementIndex, int32 DirtyGridOverflowIdx)
Definition AABBTree.h:1207
virtual TUniquePtr< ISpatialAcceleration< TPayloadType, T, 3 > > Copy() const override
Definition AABBTree.h:971
FORCEINLINE_DEBUGGABLE bool ValidateBounds(const TAABB< T, 3 > &Bounds)
Definition AABBTree.h:2366
FORCEINLINE_DEBUGGABLE int32 AddDirtyElementToGrid(const TAABB< T, 3 > &NewBounds, int32 NewDirtyElement)
Definition AABBTree.h:1171
FORCEINLINE_DEBUGGABLE bool AddNewDirtyParticleIndexToGridCell(int32 Hash, int32 NewDirtyIndex)
Definition AABBTree.h:1076
void Sweep(const FVec3 &Start, const FVec3 &Dir, const FReal Length, const FVec3 QueryHalfExtents, ISpatialVisitor< TPayloadType, FReal > &Visitor) const override
Definition AABBTree.h:995
void ComputeOverlappingCacheFromLeaf()
Definition AABBTree.h:2661
void Sweep(const FVec3 &Start, const FVec3 &Dir, const FReal Length, const FVec3 QueryHalfExtents, SQVisitor &Visitor) const
Definition AABBTree.h:1002
virtual void CacheOverlappingLeaves() override
Definition AABBTree.h:2680
FORCEINLINE_DEBUGGABLE void DeleteDirtyParticleEverywhere(int32 DeleteDirtyParticleIdx, int32 DeleteDirtyGridOverflowIdx)
Definition AABBTree.h:1119
const TArray< TPayloadBoundsElement< TPayloadType, T > > & GlobalObjects() const
Definition AABBTree.h:2172
virtual void PrepareCopyTimeSliced(const ISpatialAcceleration< TPayloadType, T, 3 > &InFrom) override
Definition AABBTree.h:2185
TPayloadType PayloadType
Definition AABBTree.h:791
bool SweepFast(const FVec3 &Start, FQueryFastData &CurData, const FVec3 QueryHalfExtents, SQVisitor &Visitor, const FVec3 &Dir, const FVec3 InvDir, const bool bParallel[3]) const
Definition AABBTree.h:1009
NodeAndLeafIndices AllocateLeafNodeAndLeaf(const TPayloadType &Payload, const TAABB< T, 3 > &NewBounds)
Definition AABBTree.h:1363
bool RaycastFast(const FVec3 &Start, FQueryFastData &CurData, SQVisitor &Visitor, const FVec3 &Dir, const FVec3 InvDir, const bool bParallel[3]) const
Definition AABBTree.h:990
virtual void ProgressCopyTimeSliced(const ISpatialAcceleration< TPayloadType, T, 3 > &InFrom, int MaximumBytesToCopy) override
Definition AABBTree.h:2248
void Reinitialize(const ParticleView &Particles, int32 InMaxChildrenInLeaf=DefaultMaxChildrenInLeaf, int32 InMaxTreeDepth=DefaultMaxTreeDepth, T InMaxPayloadBounds=DefaultMaxPayloadBounds, int32 InMaxNumToProcess=DefaultMaxNumToProcess, bool bInDynamicTree=false, bool bInbBuildOverlapCache=true)
Definition AABBTree.h:934
FORCEINLINE_DEBUGGABLE bool EnoughSpaceInGridCell(int32 Hash)
Definition AABBTree.h:1060
void Overlap(const FAABB3 &QueryBounds, SQVisitor &Visitor) const
Definition AABBTree.h:1021
virtual bool ShouldRebuild() override
Definition AABBTree.h:2178
void CopyFrom(const TAABBTree &Other)
Definition AABBTree.h:966
void Raycast(const FVec3 &Start, const FVec3 &Dir, const FReal Length, SQVisitor &Visitor) const
Definition AABBTree.h:983
void AddRootOverlappingLeaves(const TAABBTreeNode< T > &TreeNode, const bool bDirtyFilter)
Definition AABBTree.h:2538
const TArray< TAABBTreeNode< T > > & GetNodes() const
Definition AABBTree.h:2720
const TArray< TLeafType > & GetLeaves() const
Definition AABBTree.h:2721
void RotateNode(uint32 NodeIdx, bool debugAssert=false)
Definition AABBTree.h:1543
void PropagateLeavesDirtyFlag()
Definition AABBTree.h:2583
TAABBTree(const TParticles &Particles, int32 InMaxChildrenInLeaf=DefaultMaxChildrenInLeaf, int32 InMaxTreeDepth=DefaultMaxTreeDepth, T InMaxPayloadBounds=DefaultMaxPayloadBounds, int32 InMaxNumToProcess=DefaultMaxNumToProcess, bool bInDynamicTree=false, bool bInUseDirtyTree=false, bool bInBuildOverlapCache=true)
Definition AABBTree.h:888
int32 GetSiblingIndex(int32 NodeIdx)
Definition AABBTree.h:1448
void ComputeOverlappingCacheFromRoot(const bool bDirtyFilter)
Definition AABBTree.h:2604
int32 AllocateInternalNode()
Definition AABBTree.h:1335
NodeAndLeafIndices InsertLeaf(const TPayloadType &Payload, const TAABB< T, 3 > &NewBounds)
Definition AABBTree.h:1626
const AABBTreeExpensiveStatistics & GetAABBTreeExpensiveStatistics()
Definition AABBTree.h:2141
void DynamicTreeDebugStats() const
Definition AABBTree.h:1287
T TType
Definition AABBTree.h:793
virtual bool UpdateElement(const TPayloadType &Payload, const TAABB< T, 3 > &NewBounds, bool bInHasBounds) override
Definition AABBTree.h:1889
virtual void ClearShouldRebuild() override
Definition AABBTree.h:2180
virtual bool NeedUpdateElement(const TPayloadType &Payload, const TAABB< T, 3 > &NewBounds) override
Definition AABBTree.h:1867
void DeAllocateLeafNode(int32 NodeIdx)
Definition AABBTree.h:1414
void AddNodesOverlappingLeaves(const TAABBTreeNode< T > &LeftNode, const TAABB< T, 3 > &LeftBounds, const TAABBTreeNode< T > &RightNode, const TAABB< T, 3 > &RightBounds, const bool bDirtyFilter)
Definition AABBTree.h:2496
TAABBTree()
Definition AABBTree.h:800
void FillPersistentOverlappingPairs()
Definition AABBTree.h:2553
void Overlap(const FAABB3 &QueryBounds, ISpatialVisitor< TPayloadType, FReal > &Visitor) const override
Definition AABBTree.h:1014
int32 WhichChildAmI(int32 NodeIdx)
Definition AABBTree.h:1428
void SetTreeToDynamic()
Definition AABBTree.h:2183
virtual void Raycast(const FVec3 &Start, const FVec3 &Dir, const FReal Length, ISpatialVisitor< TPayloadType, FReal > &Visitor) const override
Definition AABBTree.h:976
void UpdateAncestorBounds(int32 NodeIdx, bool bDoRotation=false)
Definition AABBTree.h:1705
virtual bool RemoveElement(const TPayloadType &Payload) override
Definition AABBTree.h:1800
virtual void Reset() override
Definition AABBTree.h:819
void PrintOverlappingLeaves()
Definition AABBTree.h:2703
bool GetAsBoundsArray(TArray< TAABB< T, 3 > > &AllBounds, int32 NodeIdx, int32 ParentNode, TAABB< T, 3 > &Bounds)
Definition AABBTree.h:949
bool OverlapFast(const FAABB3 &QueryBounds, SQVisitor &Visitor) const
Definition AABBTree.h:1027
virtual TArray< TPayloadType > FindAllIntersections(const FAABB3 &Box) const override
Definition AABBTree.h:947
void FindOverlappingLeaf(const int32 FirstNode, const int32 LeafIndex, TArray< int32 > &NodeStack)
Definition AABBTree.h:2460
void DumpStats() const override
Definition AABBTree.h:1300
virtual void Serialize(FChaosArchive &Ar) override
Definition AABBTree.h:2392
FElementsCollection DebugGetElementsCollection() const
Definition AABBTree.h:1245
FORCEINLINE const TVector< T, d > & Max() const
Definition AABB.h:596
FORCEINLINE bool RaycastFast(const TVector< FReal, d > &StartPoint, const TVector< FReal, d > &Dir, const TVector< FReal, d > &InvDir, const bool *bParallel, const FReal Length, FReal &OutEntryTime, FReal &OutExitTime) const
Definition AABB.h:217
FORCEINLINE TAABB< T, d > & Thicken(const T Thickness)
Definition AABB.h:411
FORCEINLINE void GrowToInclude(const TVector< T, d > &V)
Definition AABB.h:393
static FORCEINLINE TAABB< T, d > EmptyAABB()
Definition AABB.h:623
FORCEINLINE const TVector< T, d > & Min() const
Definition AABB.h:595
Definition ISpatialAcceleration.h:509
Definition ParticleHandle.h:436
Definition ParticleHandle.h:2739
SizeType Add(const FLeafType &Item)
Definition AABBTree.h:614
void Serialize(FChaosArchive &Ar)
Definition AABBTree.h:628
const FLeafType & operator[](SizeType Index) const
Definition AABBTree.h:594
FParent::ElementType ElementType
Definition AABBTree.h:587
SizeType Num() const
Definition AABBTree.h:598
FLeafType & operator[](SizeType Index)
Definition AABBTree.h:590
void Reserve(SizeType Number)
Definition AABBTree.h:602
void Reset()
Definition AABBTree.h:606
Definition AABBTree.h:566
void Serialize(FChaosArchive &Ar)
Definition AABBTree.h:568
Definition Particles.h:32
Definition ISpatialAcceleration.h:453
Definition Archive.h:1208
virtual void Serialize(void *V, int64 Length)
Definition Archive.h:1689
virtual CORE_API void UsingCustomVersion(const struct FGuid &Guid)
Definition Archive.cpp:590
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
CORE_API int32 CustomVer(const struct FGuid &Key) const
Definition Archive.cpp:602
Definition IConsoleManager.h:1580
Definition ChaosVDDataWrapperUtils.h:77
Definition OutputDevice.h:133
void Logf(const FmtType &Fmt)
Definition OutputDevice.h:234
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void Reset(SizeType NewSize=0)
Definition Array.h:2246
InElementType ElementType
Definition Array.h:676
typename InAllocatorType::SizeType SizeType
Definition Array.h:675
UE_FORCEINLINE_HINT SizeType Emplace(ArgsType &&... Args)
Definition Array.h:2561
UE_NODEBUG UE_FORCEINLINE_HINT SizeType Add(ElementType &&Item)
Definition Array.h:2696
void Append(const TArray< OtherElementType, OtherAllocatorType > &Source)
Definition Array.h:2412
UE_NODEBUG UE_FORCEINLINE_HINT bool Find(const ElementType &Item, SizeType &Index) const
Definition Array.h:1302
ElementType Pop(EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:1196
UE_FORCEINLINE_HINT void Reserve(SizeType Number)
Definition Array.h:3016
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
UE_FORCEINLINE_HINT const bool IsValid() const
Definition SharedPointer.h:1085
Definition UniquePtr.h:107
@ HasBoundingBox
Definition ImplicitObjectType.h:68
Definition SkeletalMeshComponent.h:307
FORCEINLINE_DEBUGGABLE bool TooManyRaycastQueryCells(const FVec3 &StartPoint, const FVec3 &Dir, const FReal Length, FReal DirtyElementGridCellSizeInv, int32 DirtyElementMaxGridCellQueryCount)
Definition AABBTreeDirtyGridUtils.h:483
FORCEINLINE bool IsInPhysicsThreadContext()
Definition Threading.h:280
FORCEINLINE_DEBUGGABLE bool DoForOverlappedCells(const TAABB< T, 3 > &AABB, FReal DirtyElementGridCellSize, FReal DirtyElementGridCellSizeInv, FunctionType Function)
Definition AABBTreeDirtyGridUtils.h:69
ESpatialAcceleration
Definition ISpatialAcceleration.h:180
TAABB< T, d > ComputeWorldSpaceBoundingBox(const TParticles< T, d > &Objects, const int32 i, bool bUseVelocity=false, T Dt=0)
Definition BoundingVolumeUtilities.h:167
FRealDouble FReal
Definition Real.h:22
FORCEINLINE_DEBUGGABLE bool DeleteValueFromSortedSubArray(TArray< int32 > &Array, int32 Value, int32 StartIndex, int32 Count)
Definition AABBTreeDirtyGridUtils.h:223
CHAOS_API int32 MaxDirtyElements
Definition BoundingVolume.cpp:21
FORCEINLINE_DEBUGGABLE void DoForRaycastIntersectCells(const FVec3 &StartPoint, const FVec3 &Dir, FReal Length, FReal DirtyElementGridCellSize, FReal DirtyElementGridCellSizeInv, FunctionType InFunction)
Definition AABBTreeDirtyGridUtils.h:516
FORCEINLINE_DEBUGGABLE bool TooManySweepQueryCells(const TVec3< FReal > &QueryHalfExtents, const FVec3 &StartPoint, const FVec3 &Dir, FReal Length, FReal DirtyElementGridCellSizeInv, int32 DirtyElementMaxGridCellQueryCount)
Definition AABBTreeDirtyGridUtils.h:241
bool PrePreFilterHelper(const FAccelerationStructureHandle &Payload, const Private::FSimOverlapVisitor &Visitor)
Definition SpatialAccelerationBroadPhase.h:323
@ Raycast
Definition SimulationModuleBase.h:145
TVector< FReal, 3 > FVec3
Definition Core.h:17
FORCEINLINE_DEBUGGABLE bool TooManyOverlapQueryCells(const TAABB< T, 3 > &AABB, FReal DirtyElementGridCellSizeInv, int32 MaximumOverlap)
Definition AABBTreeDirtyGridUtils.h:46
FORCEINLINE_DEBUGGABLE bool InsertValueIntoSortedSubArray(TArray< int32 > &Array, int32 Value, int32 StartIndex, int32 Count)
Definition AABBTreeDirtyGridUtils.h:192
FORCEINLINE_DEBUGGABLE bool DoForOverlappedCellsExclude(const TAABB< T, 3 > &AABB, const TAABB< T, 3 > &AABBExclude, FReal DirtyElementGridCellSize, FReal DirtyElementGridCellSizeInv, FunctionType Function)
Definition AABBTreeDirtyGridUtils.h:92
TAABB< FReal, 3 > FAABB3
Definition ImplicitObject.h:34
EAABBQueryType
Definition AABBTree.h:84
void DoForSweepIntersectCells(const FVec3 QueryHalfExtents, const FVec3 &StartPoint, const FVec3 &Dir, FReal Length, FReal DirtyElementGridCellSize, FReal DirtyElementGridCellSizeInv, FunctionType InFunction)
Definition AABBTreeDirtyGridUtils.h:442
@ Log
Definition LogVerbosity.h:40
@ NodeEntry
Definition Script.h:356
@ Visitor
Definition XmppMultiUserChat.h:94
constexpr VectorRegister4Double DoubleSmallNumber
Definition UnrealMathVectorConstants.h.inl:71
@ Start
Definition GeoEnum.h:100
FORCEINLINE UE_STRING_CLASS RhsType && Rhs
Definition String.cpp.inl:718
@ false
Definition radaudio_common.h:23
U16 Index
Definition radfft.cpp:71
Definition AABBTree.h:116
int32 StatMaxDirtyElements
Definition AABBTree.h:136
int32 StatMaxLeafSize
Definition AABBTree.h:137
int32 StatMaxTreeDepth
Definition AABBTree.h:138
AABBTreeExpensiveStatistics & MergeStatistics(const AABBTreeExpensiveStatistics &Rhs)
Definition AABBTree.h:126
void Reset()
Definition AABBTree.h:117
int32 StatGlobalPayloadsSize
Definition AABBTree.h:139
int32 StatMaxNumLeaves
Definition AABBTree.h:135
int32 StatNumElementsTooLargeForGrid
Definition AABBTree.h:110
void Reset()
Definition AABBTree.h:92
int32 StatNumNonEmptyCellsInGrid
Definition AABBTree.h:109
int32 StatNumGridOverflowElements
Definition AABBTree.h:112
AABBTreeStatistics & MergeStatistics(const AABBTreeStatistics &Rhs)
Definition AABBTree.h:100
int32 StatNumDirtyElements
Definition AABBTree.h:111
Definition AABBTree.h:150
auto Requires(ElementT &InElem, const ElementT &InOtherElem) -> decltype(InElem.UpdateFrom(InOtherElem))
Definition AABBTree.h:758
int32 Index
Definition AABBTree.h:771
DirtyGridHashEntry(const DirtyGridHashEntry &Other)
Definition AABBTree.h:765
DirtyGridHashEntry()
Definition AABBTree.h:759
int32 Count
Definition AABBTree.h:772
Definition AABBTree.h:720
int32 GlobalPayloadIdx
Definition AABBTree.h:721
FAABBTreePayloadInfo(int32 InGlobalPayloadIdx=INDEX_NONE, int32 InDirtyIdx=INDEX_NONE, int32 InLeafIdx=INDEX_NONE, int32 InDirtyGridOverflowIdx=INDEX_NONE, int32 InNodeIdx=INDEX_NONE)
Definition AABBTree.h:727
int32 DirtyPayloadIdx
Definition AABBTree.h:722
int32 NodeIdx
Definition AABBTree.h:725
int32 LeafIdx
Definition AABBTree.h:723
void Serialize(FArchive &Ar)
Definition AABBTree.h:735
int32 DirtyGridOverflowIdx
Definition AABBTree.h:724
Definition ISpatialAcceleration.h:64
Definition ISpatialAcceleration.h:14
const FVec3 & Dir
Definition ISpatialAcceleration.h:24
const FVec3 InvDir
Definition ISpatialAcceleration.h:25
FReal CurrentLength
Definition ISpatialAcceleration.h:27
FReal InvCurrentLength
Definition ISpatialAcceleration.h:28
const bool bParallel[3]
Definition ISpatialAcceleration.h:30
static FORCEINLINE_DEBUGGABLE bool Intersects(const FVec3 &Start, FQueryFastDataVoid &QueryFastData, FReal &TOI, const FAABB3 &Bounds, const FAABB3 &QueryBounds, const FVec3 &QueryHalfExtents, const FVec3 &Dir, const FVec3 InvDir, const bool bParallel[3])
Definition AABBTree.h:209
static FORCEINLINE_DEBUGGABLE bool Intersects(const FVec3 &Start, FQueryFastData &QueryFastData, FReal &TOI, const FAABB3 &Bounds, const FAABB3 &QueryBounds, const FVec3 &QueryHalfExtents, const FVec3 &Dir, const FVec3 InvDir, const bool bParallel[3])
Definition AABBTree.h:184
static FORCEINLINE_DEBUGGABLE bool Intersects(const FVec3 &Start, FQueryFastData &QueryFastData, FReal &TOI, const FAABB3 &Bounds, const FAABB3 &QueryBounds, const FVec3 &QueryHalfExtents, const FVec3 &Dir, const FVec3 InvDir, const bool bParallel[3])
Definition AABBTree.h:196
Definition AABBTree.h:172
static bool Intersects(const FVec3 &Start, TQueryFastData &QueryFastData, FReal &TOI, const FAABB3 &Bounds, const FAABB3 &QueryBounds, const FVec3 &QueryHalfExtents, const FVec3 &Dir, const FVec3 InvDir, const bool bParallel[3])
Definition AABBTree.h:173
Definition AABBTree.h:260
TArray< TPayloadBoundsElement< TPayloadType, T > > Elems
Definition AABBTree.h:547
SIZE_T GetReserveCount() const
Definition AABBTree.h:274
void UpdateElementWithoutDirty(const TPayloadType &Payload, const TAABB< T, 3 > &NewBounds)
Definition AABBTree.h:486
FORCEINLINE_DEBUGGABLE bool SweepFast(const TVec3< T > &Start, TQueryFastData &QueryFastData, const TVec3< T > &QueryHalfExtents, TSQVisitor &Visitor, const TVec3< T > &Dir, const TVec3< T > InvDir, const bool bParallel[3]) const
Definition AABBTree.h:319
FORCEINLINE_DEBUGGABLE bool RaycastFastSimd(const VectorRegister4Double &Start, TQueryFastData &QueryFastData, TSQVisitor &Visitor, const VectorRegister4Double &Dir, const VectorRegister4Double &InvDir, const VectorRegister4Double &Parallel, const VectorRegister4Double &Length) const
Definition AABBTree.h:313
void Reset()
Definition AABBTree.h:505
bool bDirtyLeaf
Definition AABBTree.h:550
FORCEINLINE_DEBUGGABLE bool RaycastFast(const TVec3< T > &Start, TQueryFastData &QueryFastData, TSQVisitor &Visitor, const TVec3< T > &Dir, const TVec3< T > &InvDir, const bool bParallel[3]) const
Definition AABBTree.h:307
void PrintLeaf() const
Definition AABBTree.h:530
FORCEINLINE_DEBUGGABLE bool RaycastImpSimd(const VectorRegister4Double &Start, TQueryFastData &QueryFastData, TSQVisitor &Visitor, const VectorRegister4Double &InvDir, const VectorRegister4Double &Parallel, const VectorRegister4Double &Length) const
Definition AABBTree.h:427
void DebugDrawLeaf(ISpacialDebugDrawInterface< T > &InInterface, const FLinearColor &InLinearColor, float InThickness) const
Definition AABBTree.h:512
SIZE_T GetElementCount() const
Definition AABBTree.h:280
TAABBTreeLeafArray()
Definition AABBTree.h:261
FORCEINLINE_DEBUGGABLE bool RaycastSweepImp(const TVec3< T > &Start, TQueryFastData &QueryFastData, const TVec3< T > &QueryHalfExtents, TSQVisitor &Visitor, const TVec3< T > &Dir, const TVec3< T > InvDir, const bool bParallel[3]) const
Definition AABBTree.h:400
void RecomputeBounds(bool bDynamicTree)
Definition AABBTree.h:285
void UpdateElement(const TPayloadType &Payload, const TAABB< T, 3 > &NewBounds, bool bHasBounds)
Definition AABBTree.h:469
bool IsLeafDirty() const
Definition AABBTree.h:293
bool OverlapFast(const FAABB3 &QueryBounds, TSQVisitor &Visitor) const
Definition AABBTree.h:326
void AddElement(const TPayloadBoundsElement< TPayloadType, T > &Element)
Definition AABBTree.h:499
void Serialize(FChaosArchive &Ar)
Definition AABBTree.h:542
void GatherElements(TArray< TPayloadBoundsElement< TPayloadType, T > > &OutElements) const
Definition AABBTree.h:269
void RemoveElement(TPayloadType Payload)
Definition AABBTree.h:452
TAABBTreeLeafArray(const TArray< TPayloadBoundsElement< TPayloadType, T > > &InElems)
Definition AABBTree.h:263
void SetDirtyState(const bool bDirtyState)
Definition AABBTree.h:301
Definition AABBTree.h:648
TAABB< T, 3 > ChildrenBounds[2]
Definition AABBTree.h:657
bool bDirtyNode
Definition AABBTree.h:661
int32 ChildrenNodes[2]
Definition AABBTree.h:658
void DebugDraw(ISpacialDebugDrawInterface< T > &InInterface, const TArray< TAABBTreeNode< T > > &Nodes, const FVec3 &InLinearColor, float InThickness) const
Definition AABBTree.h:664
bool bLeaf
Definition AABBTree.h:660
void Serialize(FChaosArchive &Ar)
Definition AABBTree.h:687
TAABBTreeNode()
Definition AABBTree.h:649
int32 ParentNode
Definition AABBTree.h:659
Definition AABBTree.h:911
Definition AABBTree.h:1238
TArray< FElement > AllElements
Definition AABBTree.h:1239
int32 DepthTotal
Definition AABBTree.h:1240
int32 DirtyElementCount
Definition AABBTree.h:1242
int32 MaxDepth
Definition AABBTree.h:1241
Definition AABBTree.h:1358
int32 NodeIdx
Definition AABBTree.h:1359
int32 LeafIdx
Definition AABBTree.h:1360
const TAABB< T, 3 > GetBounds() const
Definition AABBTree.h:252
void ComputeBounds(const TArray< TPayloadBoundsElement< TPayloadType, T > > &, bool bDynamicTree)
Definition AABBTree.h:248
void ComputeBounds(const TArray< TPayloadBoundsElement< TPayloadType, T > > &Elems, bool bDynamicTree)
Definition AABBTree.h:224
const TAABB< T, 3 > & GetBounds() const
Definition AABBTree.h:239
Definition AABBTree.h:218
Definition AABBTree.h:777
static void InitPayloadToInfo(PayloadToInfoType &PayloadToInfo)
Definition AABBTree.h:780
Definition ISpatialAcceleration.h:226
Definition ISpatialAcceleration.h:99
static CHAOS_API FAutoConsoleVariableRef CVarMinNodesChunkToProcessBetweenTimeChecks
Definition AABBTree.h:72
static CHAOS_API float MaxProcessingTimePerSliceSeconds
Definition AABBTree.h:68
static CHAOS_API FAutoConsoleVariableRef CVarUseTimeSliceByMillisecondBudget
Definition AABBTree.h:66
static CHAOS_API bool bUseTimeSliceMillisecondBudget
Definition AABBTree.h:65
static CHAOS_API FAutoConsoleVariableRef CVarMaxProcessingTimePerSlice
Definition AABBTree.h:69
static CHAOS_API int32 MinDataChunkToProcessBetweenTimeChecks
Definition AABBTree.h:74
static CHAOS_API FAutoConsoleVariableRef CVarMinDataChunkToProcessBetweenTimeChecks
Definition AABBTree.h:75
static CHAOS_API int32 MinNodesChunkToProcessBetweenTimeChecks
Definition AABBTree.h:71
static CHAOS_API int32 SplitAtAverageCenter
Definition AABBTree.h:31
static CHAOS_API float DynamicTreeBoundingBoxPadding
Definition AABBTree.h:37
static CHAOS_API int32 UpdateDirtyElementPayloadData
Definition AABBTree.h:28
static CHAOS_API FAutoConsoleVariableRef CVarSplitAtAverageCenter
Definition AABBTree.h:32
static CHAOS_API float DynamicTreeLeafEnlargePercent
Definition AABBTree.h:40
static CHAOS_API int32 DynamicTreeLeafCapacity
Definition AABBTree.h:43
static CHAOS_API int32 SplitOnVarianceAxis
Definition AABBTree.h:34
static CHAOS_API FAutoConsoleVariableRef CVarUpdateDirtyElementPayloadData
Definition AABBTree.h:29
static CHAOS_API FAutoConsoleVariableRef CVarDynamicTreeLeafCapacity
Definition AABBTree.h:44
static CHAOS_API FAutoConsoleVariableRef CVarSplitOnVarianceAxis
Definition AABBTree.h:35
static CHAOS_API FAutoConsoleVariableRef CVarDynamicTreeLeafEnlargePercent
Definition AABBTree.h:41
static CHAOS_API FAutoConsoleVariableRef CVarDynamicTreeBoundingBoxPadding
Definition AABBTree.h:38
static CHAOS_API FAutoConsoleVariableRef CVarDirtyElementMaxCellCapacity
Definition AABBTree.h:60
static CHAOS_API FAutoConsoleVariableRef CVarDirtyElementMaxGridCellQueryCount
Definition AABBTree.h:54
static CHAOS_API int32 DirtyElementMaxPhysicalSizeInCells
Definition AABBTree.h:56
static CHAOS_API FAutoConsoleVariableRef CVarDirtyElementGridCellSize
Definition AABBTree.h:51
static CHAOS_API int32 DirtyElementMaxGridCellQueryCount
Definition AABBTree.h:53
static CHAOS_API int32 DirtyElementMaxCellCapacity
Definition AABBTree.h:59
static CHAOS_API int32 DirtyElementGridCellSize
Definition AABBTree.h:50
static CHAOS_API FAutoConsoleVariableRef CVarDirtyElementMaxPhysicalSizeInCells
Definition AABBTree.h:57
static double Seconds()
Definition AndroidPlatformTime.h:20
CORE_API static const FGuid GUID
Definition ExternalPhysicsCustomObjectVersion.h:144
@ ImmutableAABBTree
Definition ExternalPhysicsCustomObjectVersion.h:94
@ RemovedAABBTreeFullBounds
Definition ExternalPhysicsCustomObjectVersion.h:133
static CORE_API const FLinearColor Green
Definition Color.h:461
static CORE_API const FLinearColor Red
Definition Color.h:460
static CORE_API FLinearColor MakeRandomColor()
Definition Color.cpp:488
static UE_FORCEINLINE_HINT bool IsNearlyZero(float Value, float ErrorTolerance=UE_SMALL_NUMBER)
Definition UnrealMathUtility.h:407
Definition NumericLimits.h:41
Definition SQVisitor.h:43
Definition UnrealMathFPU.h:42