Navigation
API > API/Runtime > API/Runtime/Chaos
| Name | TAABBTree |
| Type | class |
| Header File | /Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/AABBTree.h |
| Include Path | #include "Chaos/AABBTree.h" |
Syntax
template<typename TPayloadType, typename TLeafType, bool bMutable, typename T, typename StorageTraits>
class TAABBTree : public Chaos::ISpatialAcceleration< TPayloadType, FReal, 3 >
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TAABBTree
(
const TParticles& Particles, |
Chaos/AABBTree.h | ||
TAABBTree () |
Chaos/AABBTree.h | ||
| Chaos/AABBTree.h | |||
| Chaos/AABBTree.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~TAABBTree() |
Chaos/AABBTree.h |
Structs
| Name | Remarks |
|---|---|
| EmptyInit | Tag dispatch enable for the below constructor to allow setting up the defaults without an initial set of particles. |
| FElementsCollection | |
| FSplitInfo | |
| FWorkSnapshot | |
| NodeAndLeafIndices |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FElement | TPayloadBoundsElement< TPayloadType, T > | Chaos/AABBTree.h | |
| FNode | TAABBTreeNode< T > | Chaos/AABBTree.h | |
| FNodeIndexAndCost | TTuple< FNode &, int32, FReal > | Buffers for calculating the best candidate for tree insertion, reset per-calculation to avoid over allocation Tuple of Node/Index/Cost here avoids cache miss when accessing the node and its cost. | Chaos/AABBTree.h |
| PayloadType | TPayloadType | Chaos/AABBTree.h | |
| TType | T | Chaos/AABBTree.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| D | int | Chaos/AABBTree.h | |
| DefaultMaxChildrenInLeaf | int32 | Chaos/AABBTree.h | |
| DefaultMaxNumToProcess | int32 | Chaos/AABBTree.h | |
| DefaultMaxPayloadBounds | T | Chaos/AABBTree.h | |
| DefaultMaxTreeDepth | int32 | Chaos/AABBTree.h | |
| StaticType | ESpatialAcceleration | Chaos/AABBTree.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bBuildOverlapCache | bool | Chaos/AABBTree.h | ||
| bDynamicTree | bool | DynamicTree members. | Chaos/AABBTree.h | |
| bModifyingTreeMultiThreadingFastCheck | bool | Chaos/AABBTree.h | ||
| bShouldRebuild | bool | Chaos/AABBTree.h | ||
| CellHashToFlatArray | TMap< int32, DirtyGridHashEntry > | Data needed for DirtyElement2DAccelerationGrid. | Chaos/AABBTree.h | |
| CurrentDataElementsCopiedSinceLastCheck | int32 | Chaos/AABBTree.h | ||
| CurrentProcessedNodesSinceChecked | int32 | Chaos/AABBTree.h | ||
| DirtyElementGridCellSize | T | Copy of CVARS. | Chaos/AABBTree.h | |
| DirtyElementGridCellSizeInv | T | Chaos/AABBTree.h | ||
| DirtyElementMaxCellCapacity | int32 | Chaos/AABBTree.h | ||
| DirtyElementMaxGridCellQueryCount | int32 | Chaos/AABBTree.h | ||
| DirtyElementMaxPhysicalSizeInCells | int32 | Chaos/AABBTree.h | ||
| DirtyElements | TArray< FElement > | Chaos/AABBTree.h | ||
| DirtyElementsGridOverflow | TArray< int32 > | Chaos/AABBTree.h | ||
| DirtyElementTree | TUniquePtr< TAABBTree > | Members for using a dynamic tree as a dirty element acceleration structure. | Chaos/AABBTree.h | |
| FirstFreeInternalNode | int32 | Free lists (indices are in Nodes array) | Chaos/AABBTree.h | |
| FirstFreeLeafNode | int32 | Chaos/AABBTree.h | ||
| FlattenedCellArrayOfDirtyIndices | TArray< int32 > | Chaos/AABBTree.h | ||
| GlobalPayloads | TArray< FElement > | Chaos/AABBTree.h | ||
| Leaves | TLeafContainer< TLeafType > | Chaos/AABBTree.h | ||
| MaxChildrenInLeaf | int32 | Chaos/AABBTree.h | ||
| MaxNumToProcess | int32 | Chaos/AABBTree.h | ||
| MaxPayloadBounds | T | Chaos/AABBTree.h | ||
| MaxTreeDepth | int32 | Chaos/AABBTree.h | ||
| Nodes | TArray< FNode > | Chaos/AABBTree.h | ||
| NumProcessedThisSlice | int32 | Chaos/AABBTree.h | ||
| OverlappingCounts | TArray< int32 > | Number of overlapping leaves per leaf | Chaos/AABBTree.h | |
| OverlappingLeaves | TArray< int32 > | Flat array of overlapping leaves. | Chaos/AABBTree.h | |
| OverlappingOffsets | TArray< int32 > | Offset for each leaf in the overlapping leaves (OverlappingOffsets[LeafIndex]/OverlappingOffsets[LeafIndex+1] will be start/end indices of the leaf index in the overallping leaves array ) | Chaos/AABBTree.h | |
| OverlappingPairs | TArray< FIntVector2 > | List of leaves intersecting pairs that will be used to build the flat arrays (offsets,leaves) | Chaos/AABBTree.h | |
| PayloadToInfo | StorageTraits::PayloadToInfoType | Chaos/AABBTree.h | ||
| PriorityQ | TArray< FNodeIndexAndCost > | Chaos/AABBTree.h | ||
| RootNode | int32 | Chaos/AABBTree.h | ||
| StartSliceTimeStamp | double | Chaos/AABBTree.h | ||
| TreeExpensiveStats | AABBTreeExpensiveStatistics | Chaos/AABBTree.h | ||
| TreeStats | AABBTreeStatistics | Some useful statistics. | Chaos/AABBTree.h | |
| WorkPool | TArray< FWorkSnapshot > | Chaos/AABBTree.h | ||
| WorkPoolFreeList | TArray< int32 > | Chaos/AABBTree.h | ||
| WorkStack | TArray< int32 > | Chaos/AABBTree.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 AddDirtyElementToGrid
(
const TAABB< T, 3 >& NewBounds, |
Chaos/AABBTree.h | ||
bool AddNewDirtyParticleIndexToGridCell
(
int32 Hash, |
Returns true if there was enough space in the cell to add the new dirty element index or if the element was already added (This second condition should not happen) | Chaos/AABBTree.h | |
void AddNodesOverlappingLeaves
(
const TAABBTreeNode< T >& LeftNode, |
Recursively add overlapping leaves given 2 nodes in the tree | Chaos/AABBTree.h | |
void AddRootOverlappingLeaves
(
const TAABBTreeNode< T >& TreeNode, |
Recursively add overlapping leaves given a root node in the tree | Chaos/AABBTree.h | |
int32 AllocateInternalNode() |
Chaos/AABBTree.h | ||
NodeAndLeafIndices AllocateLeafNodeAndLeaf
(
const TPayloadType& Payload, |
Chaos/AABBTree.h | ||
void ComputeOverlappingCacheFromLeaf() |
Sequential loop over the leaves to fill the overlapping pairs | Chaos/AABBTree.h | |
void ComputeOverlappingCacheFromRoot
(
const bool bDirtyFilter |
Simultaneous tree descent to compute the overlapping leaves | Chaos/AABBTree.h | |
void CopyFrom
(
const TAABBTree& Other |
Chaos/AABBTree.h | ||
void DeAllocateInternalNode
(
int32 NodeIdx |
Chaos/AABBTree.h | ||
void DeAllocateLeafNode
(
int32 NodeIdx |
Chaos/AABBTree.h | ||
FElementsCollection DebugGetElementsCollection() |
Chaos/AABBTree.h | ||
void DeleteDirtyParticleEverywhere
(
int32 DeleteDirtyParticleIdx, |
Chaos/AABBTree.h | ||
bool DeleteDirtyParticleIndexFromGridCell
(
int32 Hash, |
Returns true if the dirty particle was in the grid and successfully deleted. | Chaos/AABBTree.h | |
bool DirtyElementGridEnabled() |
Chaos/AABBTree.h | ||
void DynamicTreeDebugStats() |
Expensive function: Don't call unless debugging. | Chaos/AABBTree.h | |
bool EnoughSpaceInGridCell
(
int32 Hash |
Chaos/AABBTree.h | ||
void FillPersistentOverlappingPairs() |
Fill the overlapping pairs from the previous persistent and not dirty leaves | Chaos/AABBTree.h | |
int32 FindBestSibling
(
const TAABB< T, 3 >& InNewBounds, |
Chaos/AABBTree.h | ||
void FindOverlappingLeaf
(
const int32 FirstNode, |
Given a first node and a leaf index find the overlapping leaves and update the node stack | Chaos/AABBTree.h | |
const AABBTreeExpensiveStatistics & GetAABBTreeExpensiveStatistics() |
Chaos/AABBTree.h | ||
const AABBTreeStatistics & GetAABBTreeStatistics() |
Some useful statistics. | Chaos/AABBTree.h | |
| Chaos/AABBTree.h | |||
void GetCVars() |
This is to make sure important parameters are not changed during inopportune times. | Chaos/AABBTree.h | |
const TArray< TLeafType > & GetLeaves() |
Chaos/AABBTree.h | ||
const TArray< TAABBTreeNode< T > > & GetNodes() |
Chaos/AABBTree.h | ||
int32 GetSiblingIndex
(
int32 NodeIdx |
Is the input node Child 0 or Child 1? | Chaos/AABBTree.h | |
const int32 GetSubtreeDepth
(
const int32 NodeIdx |
Chaos/AABBTree.h | ||
const TArray< TPayloadBoundsElement< TPayloadType, T > > & GlobalObjects() |
Chaos/AABBTree.h | ||
NodeAndLeafIndices InsertLeaf
(
const TPayloadType& Payload, |
Returns the inserted node and leaf. | Chaos/AABBTree.h | |
virtual bool NeedUpdateElement
(
const TPayloadType& Payload, |
Returns true if the payload's leaf need to be updated, false if the Payload can stay in the same leaf without changing the leaf size. | Chaos/AABBTree.h | |
int32 NumDirtyElements() |
Chaos/AABBTree.h | ||
void Overlap
(
const FAABB3& QueryBounds, |
Chaos/AABBTree.h | ||
bool OverlapFast
(
const FAABB3& QueryBounds, |
Chaos/AABBTree.h | ||
virtual void PrepareCopyTimeSliced
(
const ISpatialAcceleration< TPayloadType, T, 3 >& InFrom |
Chaos/AABBTree.h | ||
void PrintOverlappingLeaves() |
Print the overlapping leaves data structure | Chaos/AABBTree.h | |
virtual void ProgressCopyTimeSliced
(
const ISpatialAcceleration< TPayloadType, T, 3 >& InFrom, |
Chaos/AABBTree.h | ||
void PropagateLeavesDirtyFlag() |
Propagates the leaves dirty flag up to the root node | Chaos/AABBTree.h | |
void Raycast
(
const FVec3& Start, |
Chaos/AABBTree.h | ||
bool RaycastFast
(
const FVec3& Start, |
Chaos/AABBTree.h | ||
void Reinitialize
(
const ParticleView& Particles, |
Chaos/AABBTree.h | ||
void RemoveLeafNode
(
int32 LeafNodeIdx, |
Chaos/AABBTree.h | ||
void RotateNode
(
uint32 NodeIdx, |
Rotate nodes to decrease tree cost Grandchildren can swap with their aunts | Chaos/AABBTree.h | |
void SetTreeToDynamic() |
Chaos/AABBTree.h | ||
void Sweep
(
const FVec3& Start, |
Chaos/AABBTree.h | ||
bool SweepFast
(
const FVec3& Start, |
Chaos/AABBTree.h | ||
void UpdateAncestorBounds
(
int32 NodeIdx, |
Chaos/AABBTree.h | ||
int32 UpdateDirtyElementInGrid
(
const TAABB< T, 3 >& NewBounds, |
Chaos/AABBTree.h | ||
virtual bool UpdateElement
(
const TPayloadType& Payload, |
Returns true if element was updated, or false when it was added instead. | Chaos/AABBTree.h | |
bool ValidateBounds
(
const TAABB< T, 3 >& Bounds |
Returns true if bounds appear valid. Returns false if extremely large values, contains NaN, or is empty. | Chaos/AABBTree.h | |
int32 WhichChildAmI
(
int32 NodeIdx |
Is the input node Child 0 or Child 1? | Chaos/AABBTree.h |
Overridden from ISpatialAcceleration
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void CacheOverlappingLeaves() |
Cache for each leaves all the overlapping leaves | Chaos/AABBTree.h | |
virtual void ClearShouldRebuild() |
Contract: bShouldRebuild can only ever be cleared by calling the ClearShouldRebuild method, it can be set at will though. | Chaos/AABBTree.h | |
virtual TUniquePtr< ISpatialAcceleration< TPayloadType, T, 3 > > Copy() |
Chaos/AABBTree.h | ||
virtual void DumpStats() |
Chaos/AABBTree.h | ||
virtual void DumpStatsTo
(
FOutputDevice& Ar |
Chaos/AABBTree.h | ||
virtual TArray< TPayloadType > FindAllIntersections
(
const FAABB3& Box |
IMPORTANT : (LWC) this API should be typed on Freal not T, as we want the query API to be using the highest precision while maintaining arbitrary internal precision for the acceleration structure ( based on T ) | Chaos/AABBTree.h | |
virtual bool IsTreeDynamic() |
Chaos/AABBTree.h | ||
virtual void Overlap
(
const FAABB3& QueryBounds, |
Chaos/AABBTree.h | ||
virtual void ProgressAsyncTimeSlicing
(
bool ForceBuildCompletion |
Chaos/AABBTree.h | ||
virtual void Raycast
(
const FVec3& Start, |
Chaos/AABBTree.h | ||
virtual bool RemoveElement
(
const TPayloadType& Payload |
Returns true if element was removed successfully. | Chaos/AABBTree.h | |
virtual void Reset() |
Chaos/AABBTree.h | ||
virtual void Serialize
(
FChaosArchive& Ar |
Chaos/AABBTree.h | ||
virtual bool ShouldRebuild() |
Chaos/AABBTree.h | ||
virtual void Sweep
(
const FVec3& Start, |
Chaos/AABBTree.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void AddToContainerHelper
(
const ContainerType& ContainerFrom, |
Set InOutMaxSize to less than 0 for unlimited | Chaos/AABBTree.h | |
static int32 ContainerElementSizeHelper
(
const ContainerType& Container, |
Chaos/AABBTree.h | ||
static bool ContinueTimeSliceCopy
(
const ContainerType& ContainerFrom, |
Chaos/AABBTree.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Chaos/AABBTree.h |