UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
THierarchicalSpatialHashGrid< BlockTraitsType > Class Template Reference

#include <HierarchicalSpatialHashGrid.h>

Classes

struct  FCellBlock
 
struct  FHasher
 
struct  TFootprint
 

Public Types

using FBlockLoc = typename BlockTraitsType::FBlockLoc
 
using FLocation64 = RenderingSpatialHash::TLocation< int64 >
 
using FLocation32 = RenderingSpatialHash::TLocation< int32 >
 
using FLocation8 = RenderingSpatialHash::TLocation< int8 >
 
using FInt8Vector3 = UE::Math::TIntVector3< int8 >
 
using FFootprint64 = TFootprint< int64 >
 
using FFootprint32 = TFootprint< int32 >
 
using FFootprint8 = TFootprint< int8 >
 
using FSpatialHashMap = Experimental::TRobinHoodHashMap< FBlockLoc, FCellBlock, FHasher >
 
using FBlockId = Experimental::FHashElementId
 
using FHashElementId = Experimental::FHashElementId
 

Public Member Functions

 THierarchicalSpatialHashGrid ()=default
 
 THierarchicalSpatialHashGrid (double MinCellSize, double MaxCellSize)
 
void Empty ()
 
int32 GetMaxNumBlocks () const
 
double GetRecCellSize (int32 Level) const
 
FLocation64 ToCellLoc (int32 Level, const FVector &WorldPos) const
 
FFootprint64 CalcFootprintSphere (int32 Level, const FVector &Origin, double Radius) const
 
FFootprint64 CalcLevelAndFootprint (const FBoxSphereBounds &BoxSphereBounds) const
 
FLocation64 CalcLevelAndLocation (const FBoxSphereBounds &BoxSphereBounds) const
 
FLocation64 CalcLevelAndLocation (const FVector4d &Sphere) const
 
bool IsValidLevel (int32 Level) const
 
double GetLastLevelCellSize () const
 
double GetMaxCullingDistance () const
 
int32 NumLevels () const
 
FBox CalcCellBounds (const FLocation64 &CellLoc) const
 
FBox CalcBlockBounds (const FLocation64 &BlockLoc) const
 
FVector3d CalcBlockWorldPosition (const FLocation64 &BlockLoc) const
 
FVector3d CalcBlockWorldPosition (const FBlockLoc &BlockLoc) const
 
int32 GetFirstLevel () const
 
FCellBlockGetBlockById (const FBlockId &BlockId)
 
const FCellBlockGetBlockById (const FBlockId &BlockId) const
 
FBlockLoc GetBlockLocById (const FBlockId &BlockId) const
 
const FSpatialHashMapGetHashMap () const
 
FSpatialHashMapGetHashMap ()
 

Static Public Member Functions

static int32 CalcLevel (float Size)
 
static int32 CalcLevelFromRadius (float Radius)
 
static double GetCellSize (int32 Level)
 
static FFootprint64 CalcCellBlockFootprint (const FFootprint64 &Footprint)
 

Static Public Attributes

static constexpr int32 CellBlockDimLog2 = BlockTraitsType::CellBlockDimLog2
 
static constexpr int32 kMaxLevel = 64
 
static constexpr int32 NumCellsPerBlockLog2 = CellBlockDimLog2 * 3
 
static constexpr int32 CellBlockDim = 1 << CellBlockDimLog2
 
static constexpr uint32 LocalCellCoordMask = uint32(CellBlockDim) - 1U
 
static constexpr int32 CellBlockSize = CellBlockDim * CellBlockDim * CellBlockDim
 

Member Typedef Documentation

◆ FBlockId

◆ FBlockLoc

using THierarchicalSpatialHashGrid< BlockTraitsType >::FBlockLoc = typename BlockTraitsType::FBlockLoc

◆ FFootprint32

◆ FFootprint64

◆ FFootprint8

◆ FHashElementId

◆ FInt8Vector3

◆ FLocation32

◆ FLocation64

◆ FLocation8

◆ FSpatialHashMap

Constructor & Destructor Documentation

◆ THierarchicalSpatialHashGrid() [1/2]

◆ THierarchicalSpatialHashGrid() [2/2]

Member Function Documentation

◆ CalcBlockBounds()

FBox THierarchicalSpatialHashGrid< BlockTraitsType >::CalcBlockBounds ( const FLocation64 BlockLoc) const
inline

◆ CalcBlockWorldPosition() [1/2]

FVector3d THierarchicalSpatialHashGrid< BlockTraitsType >::CalcBlockWorldPosition ( const FBlockLoc BlockLoc) const
inline

The reference location is always the minimum corner, unpadded by loose bounds expansion.

◆ CalcBlockWorldPosition() [2/2]

FVector3d THierarchicalSpatialHashGrid< BlockTraitsType >::CalcBlockWorldPosition ( const FLocation64 BlockLoc) const
inline

The reference location is always the minimum corner, unpadded by loose bounds expansion.

◆ CalcCellBlockFootprint()

static FFootprint64 THierarchicalSpatialHashGrid< BlockTraitsType >::CalcCellBlockFootprint ( const FFootprint64 Footprint)
inlinestatic

◆ CalcCellBounds()

FBox THierarchicalSpatialHashGrid< BlockTraitsType >::CalcCellBounds ( const FLocation64 CellLoc) const
inline

◆ CalcFootprintSphere()

FFootprint64 THierarchicalSpatialHashGrid< BlockTraitsType >::CalcFootprintSphere ( int32  Level,
const FVector Origin,
double  Radius 
) const
inline

◆ CalcLevel()

static int32 THierarchicalSpatialHashGrid< BlockTraitsType >::CalcLevel ( float  Size)
inlinestatic

◆ CalcLevelAndFootprint()

FFootprint64 THierarchicalSpatialHashGrid< BlockTraitsType >::CalcLevelAndFootprint ( const FBoxSphereBounds BoxSphereBounds) const
inline

◆ CalcLevelAndLocation() [1/2]

FLocation64 THierarchicalSpatialHashGrid< BlockTraitsType >::CalcLevelAndLocation ( const FBoxSphereBounds BoxSphereBounds) const
inline

◆ CalcLevelAndLocation() [2/2]

FLocation64 THierarchicalSpatialHashGrid< BlockTraitsType >::CalcLevelAndLocation ( const FVector4d Sphere) const
inline

◆ CalcLevelFromRadius()

static int32 THierarchicalSpatialHashGrid< BlockTraitsType >::CalcLevelFromRadius ( float  Radius)
inlinestatic

◆ Empty()

◆ GetBlockById() [1/2]

FCellBlock & THierarchicalSpatialHashGrid< BlockTraitsType >::GetBlockById ( const FBlockId BlockId)
inline

◆ GetBlockById() [2/2]

const FCellBlock & THierarchicalSpatialHashGrid< BlockTraitsType >::GetBlockById ( const FBlockId BlockId) const
inline

◆ GetBlockLocById()

FBlockLoc THierarchicalSpatialHashGrid< BlockTraitsType >::GetBlockLocById ( const FBlockId BlockId) const
inline

◆ GetCellSize()

static double THierarchicalSpatialHashGrid< BlockTraitsType >::GetCellSize ( int32  Level)
inlinestatic

◆ GetFirstLevel()

int32 THierarchicalSpatialHashGrid< BlockTraitsType >::GetFirstLevel ( ) const
inline

◆ GetHashMap() [1/2]

◆ GetHashMap() [2/2]

const FSpatialHashMap & THierarchicalSpatialHashGrid< BlockTraitsType >::GetHashMap ( ) const
inline

◆ GetLastLevelCellSize()

double THierarchicalSpatialHashGrid< BlockTraitsType >::GetLastLevelCellSize ( ) const
inline

◆ GetMaxCullingDistance()

double THierarchicalSpatialHashGrid< BlockTraitsType >::GetMaxCullingDistance ( ) const
inline

◆ GetMaxNumBlocks()

int32 THierarchicalSpatialHashGrid< BlockTraitsType >::GetMaxNumBlocks ( ) const
inline

◆ GetRecCellSize()

double THierarchicalSpatialHashGrid< BlockTraitsType >::GetRecCellSize ( int32  Level) const
inline

◆ IsValidLevel()

bool THierarchicalSpatialHashGrid< BlockTraitsType >::IsValidLevel ( int32  Level) const
inline

◆ NumLevels()

int32 THierarchicalSpatialHashGrid< BlockTraitsType >::NumLevels ( ) const
inline

◆ ToCellLoc()

FLocation64 THierarchicalSpatialHashGrid< BlockTraitsType >::ToCellLoc ( int32  Level,
const FVector WorldPos 
) const
inline

Member Data Documentation

◆ CellBlockDim

◆ CellBlockDimLog2

constexpr int32 THierarchicalSpatialHashGrid< BlockTraitsType >::CellBlockDimLog2 = BlockTraitsType::CellBlockDimLog2
staticconstexpr

◆ CellBlockSize

◆ kMaxLevel

◆ LocalCellCoordMask

constexpr uint32 THierarchicalSpatialHashGrid< BlockTraitsType >::LocalCellCoordMask = uint32(CellBlockDim) - 1U
staticconstexpr

◆ NumCellsPerBlockLog2

constexpr int32 THierarchicalSpatialHashGrid< BlockTraitsType >::NumCellsPerBlockLog2 = CellBlockDimLog2 * 3
staticconstexpr

The documentation for this class was generated from the following file: