8#include "Containers/Array.h"
10#include "Containers/Map.h"
11#include "Containers/Set.h"
131 ((ChildIndex & 1) != 0) ? 1 : 0,
132 ((ChildIndex & 2) != 0) ? 1 : 0,
133 ((ChildIndex & 4) != 0) ? 1 : 0);
519 void ParallelCollectObjectsInOverlappingCells(
559 return InitializeQueryQueue(Bounds,
560 [&Bounds](
const FAxisAlignedBox3d& CellBounds) {
return CellBounds.Intersects(Bounds); },
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define ensure( InExpression)
Definition AssertionMacros.h:464
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::Math::TVector< double > FVector3d
Definition MathFwd.h:60
UE_FORCEINLINE_HINT int32 Num() const
Definition BitArray.h:1466
int32 Add(const bool Value)
Definition BitArray.h:615
UE_FORCEINLINE_HINT void Init(bool bValue, int32 InNumBits)
Definition BitArray.h:828
Definition AssetRegistryState.h:50
static RealType Floor(const RealType Value)
Definition MathUtil.h:384
Definition ContainerAllocationPolicies.h:894
Definition StaticArray.h:26
Definition SparseDynamicOctree3.h:42
TBitArray BitArray
Definition SparseDynamicOctree3.h:44
void Set(uint32 BitIndex, bool bValue)
Definition SparseDynamicOctree3.h:54
FDynamicFlagArray()
Definition SparseDynamicOctree3.h:48
bool Get(uint32 BitIndex) const
Definition SparseDynamicOctree3.h:70
static constexpr int32 GrowChunkSize
Definition SparseDynamicOctree3.h:46
uint32 MaxIndex
Definition SparseDynamicOctree3.h:45
Definition RefCountVector.h:25
Definition SmallListSet.h:36
Definition SparseDynamicOctree3.h:165
int GetMaxTreeDepth()
Definition SparseDynamicOctree3.h:196
GEOMETRYCORE_API void Insert_Spill(int32 ObjectID, const FAxisAlignedBox3d &Bounds)
Definition SparseDynamicOctree3.cpp:124
GEOMETRYCORE_API void CheckValidity(TFunctionRef< bool(int)> IsValidObjectIDFunc, TFunctionRef< FAxisAlignedBox3d(int)> GetObjectBoundsFunc, EValidityCheckFailMode FailMode=EValidityCheckFailMode::Check, bool bVerbose=false, bool bFailOnMissingObjects=false) const
Definition SparseDynamicOctree3.cpp:806
void SetMaxTreeDepth(int MaxTreeDepthIn)
Definition SparseDynamicOctree3.h:203
GEOMETRYCORE_API FSparseOctreeCell FindCurrentContainingCell(const FAxisAlignedBox3d &Bounds) const
Definition SparseDynamicOctree3.cpp:752
GEOMETRYCORE_API int ParallelOverlapAnyQuery(const FAxisAlignedBox3d &ShapeBounds, TFunctionRef< bool(int32)> ObjectOverlapFn, TFunctionRef< bool(const FAxisAlignedBox3d &)> BoundsOverlapFn) const
Definition SparseDynamicOctree3.cpp:628
double RootDimension
Definition SparseDynamicOctree3.h:187
GEOMETRYCORE_API void Insert_NewRoot(int32 ObjectID, const FAxisAlignedBox3d &Bounds, FSparseOctreeCell NewRootCell)
Definition SparseDynamicOctree3.cpp:105
GEOMETRYCORE_API bool CheckIfObjectNeedsReinsert(int32 ObjectID, const FAxisAlignedBox3d &NewBounds, uint32 &CellIDOut) const
Definition SparseDynamicOctree3.cpp:165
TDynamicVector< uint32 > ObjectIDToCellMap
Definition SparseDynamicOctree3.h:409
FDynamicFlagArray ValidObjectIDs
Definition SparseDynamicOctree3.h:410
static constexpr uint32 MaxSupportedTreeDepth
Definition SparseDynamicOctree3.h:194
GEOMETRYCORE_API bool ContainsObject(int32 ObjectID) const
Definition SparseDynamicOctree3.cpp:19
int ParallelOverlapAnyQuery(const FAxisAlignedBox3d &ShapeBounds, TFunctionRef< bool(int32)> ObjectOverlapFn) const
Definition SparseDynamicOctree3.h:348
FVector3i PointToIndex(uint32 Level, const FVector3d &Position) const
Definition SparseDynamicOctree3.h:456
GEOMETRYCORE_API void ComputeStatistics(FStatistics &StatsOut) const
Definition SparseDynamicOctree3.cpp:911
GEOMETRYCORE_API double FindNearestRayCellIntersection(const FSparseOctreeCell &Cell, const FRay3d &Ray) const
Definition SparseDynamicOctree3.cpp:228
GEOMETRYCORE_API void Insert_ToCell(int32 ObjectID, const FAxisAlignedBox3d &Bounds, const FSparseOctreeCell &ExistingCell)
Definition SparseDynamicOctree3.cpp:90
double GetCellWidth(uint32 Level) const
Definition SparseDynamicOctree3.h:418
GEOMETRYCORE_API bool ContainmentQueryCancellable(const FVector3d &Point, TFunctionRef< bool(int)> ObjectIDFunc) const
Definition SparseDynamicOctree3.cpp:428
int ToChildCellIndex(const FSparseOctreeCell &Cell, const FVector3d &Position) const
Definition SparseDynamicOctree3.h:477
static constexpr uint32 SpillCellID
Definition SparseDynamicOctree3.h:396
GEOMETRYCORE_API void ParallelRangeQuery(const FAxisAlignedBox3d &Bounds, TArray< int > &ObjectIDsOut) const
Definition SparseDynamicOctree3.cpp:562
FVector3d GetCellCenter(const FSparseOctreeCell &Cell) const
Definition SparseDynamicOctree3.h:443
int MaxTreeDepth
Definition SparseDynamicOctree3.h:216
TSet< int32 > SpillObjectSet
Definition SparseDynamicOctree3.h:407
FSmallListSet CellObjectLists
Definition SparseDynamicOctree3.h:406
double MaxExpandFactor
Definition SparseDynamicOctree3.h:192
GEOMETRYCORE_API void RangeQuery(const FAxisAlignedBox3d &Bounds, TFunctionRef< void(int)> ObjectIDFunc) const
Definition SparseDynamicOctree3.cpp:481
TDynamicVector< FSparseOctreeCell > Cells
Definition SparseDynamicOctree3.h:403
GEOMETRYCORE_API void InsertObject(int32 ObjectID, const FAxisAlignedBox3d &Bounds)
Definition SparseDynamicOctree3.cpp:24
GEOMETRYCORE_API int32 FindNearestHitObject(const FRay3d &Ray, TFunctionRef< FAxisAlignedBox3d(int)> GetObjectBoundsFunc, TFunctionRef< double(int, const FRay3d &)> HitObjectDistFunc, double MaxDistance=TNumericLimits< double >::Max()) const
Definition SparseDynamicOctree3.cpp:244
uint32 GetCellForObject(int32 ObjectID) const
Definition SparseDynamicOctree3.h:493
bool CanFit(const FSparseOctreeCell &Cell, const FAxisAlignedBox3d &Bounds) const
Definition SparseDynamicOctree3.h:487
FAxisAlignedBox3d GetBox(uint32 Level, const FVector3i &Index, double ExpandFactor) const
Definition SparseDynamicOctree3.h:427
FAxisAlignedBox3d GetCellBox(const FSparseOctreeCell &Cell, double ExpandFactor=0) const
Definition SparseDynamicOctree3.h:439
GEOMETRYCORE_API void ContainmentQuery(const FVector3d &Point, TFunctionRef< void(int)> ObjectIDFunc) const
Definition SparseDynamicOctree3.cpp:389
TSparseGrid3< uint32 > RootCells
Definition SparseDynamicOctree3.h:414
FRefCountVector CellRefCounts
Definition SparseDynamicOctree3.h:400
static constexpr uint32 InvalidCellID
Definition SparseDynamicOctree3.h:393
GEOMETRYCORE_API void Insert_NewChildCell(int32 ObjectID, const FAxisAlignedBox3d &Bounds, int ParentCellID, FSparseOctreeCell NewChildCell, int ChildIdx)
Definition SparseDynamicOctree3.cpp:67
GEOMETRYCORE_API bool ReinsertObject(int32 ObjectID, const FAxisAlignedBox3d &NewBounds, uint32 CellIDHint=InvalidCellID)
Definition SparseDynamicOctree3.cpp:185
GEOMETRYCORE_API void BranchRangeQuery(const FSparseOctreeCell *ParentCell, const FAxisAlignedBox3d &Bounds, TArray< int > &ObjectIDs) const
Definition SparseDynamicOctree3.cpp:662
Definition DynamicVector.h:27
size_t Num() const
Definition DynamicVector.h:147
Definition SparseGrid3.h:27
TAxisAlignedBox3< double > FAxisAlignedBox3d
Definition BoxTypes.h:885
EValidityCheckFailMode
Definition GeometryTypes.h:72
Definition AdvancedWidgetsModule.cpp:13
U16 Index
Definition radfft.cpp:71
static constexpr UE_FORCEINLINE_HINT T Clamp(const T X, const T MinValue, const T MaxValue)
Definition UnrealMathUtility.h:592
Definition NumericLimits.h:41
Definition SparseDynamicOctree3.h:378
int32 SpillObjCount
Definition SparseDynamicOctree3.h:382
TArray< int32 > LevelObjCounts
Definition SparseDynamicOctree3.h:381
FString ToString() const
Definition SparseDynamicOctree3.cpp:932
int32 Levels
Definition SparseDynamicOctree3.h:379
TArray< int32 > LevelBoxCounts
Definition SparseDynamicOctree3.h:380
Definition SparseDynamicOctree3.h:83
FSparseOctreeCell()
Definition SparseDynamicOctree3.h:99
void SetChild(uint32 ChildIndex, const FSparseOctreeCell &ChildCell)
Definition SparseDynamicOctree3.h:137
static constexpr uint8 InvalidLevel
Definition SparseDynamicOctree3.h:85
bool IsExistingCell() const
Definition SparseDynamicOctree3.h:113
uint32 GetChildCellID(int ChildIndex) const
Definition SparseDynamicOctree3.h:123
TStaticArray< uint32, 8 > Children
Definition SparseDynamicOctree3.h:97
static constexpr uint32 InvalidID
Definition SparseDynamicOctree3.h:84
bool HasChild(int ChildIndex) const
Definition SparseDynamicOctree3.h:118
FSparseOctreeCell(uint8 LevelIn, const FVector3i &IndexIn)
Definition SparseDynamicOctree3.h:106
uint8 Level
Definition SparseDynamicOctree3.h:91
FSparseOctreeCell MakeChildCell(int ChildIndex)
Definition SparseDynamicOctree3.h:128
FVector3i Index
Definition SparseDynamicOctree3.h:94
uint32 CellID
Definition SparseDynamicOctree3.h:88
Definition IntVectorTypes.h:252
bool Contains(const TVector< RealType > &V) const
Definition BoxTypes.h:492