UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FSquare2DGridHelper Struct Reference

#include <RuntimeSpatialHashGridHelper.h>

Classes

struct  FGrid2D
 
struct  FGridLevel
 

Public Member Functions

ENGINE_API FSquare2DGridHelper (const FBox &InWorldBounds, const FVector &InOrigin, int64 InCellSize)
 
ENGINE_API FSquare2DGridHelper (const FBox &InWorldBounds, const FVector &InOrigin, int64 InCellSize, bool bUseAlignedGridLevels)
 
FGridLevelGetLowestLevel ()
 
FGridLevel::FGridCellGetAlwaysLoadedCell ()
 
const FGridLevel::FGridCellGetAlwaysLoadedCell () const
 
const FGridLevel::FGridCellGetCell (const FGridCellCoord &InCoords) const
 
bool GetCellBounds (const FGridCellCoord &InCoords, FBox2D &OutBounds) const
 
bool GetCellGlobalCoords (const FGridCellCoord &InCoords, FGridCellCoord &OutGlobalCoords) const
 
ENGINE_API void ForEachCells (TFunctionRef< void(const FSquare2DGridHelper::FGridLevel::FGridCell &)> InOperation) const
 
ENGINE_API int32 ForEachIntersectingCells (const FBox &InBox, TFunctionRef< void(const FGridCellCoord &)> InOperation, int32 InStartLevel=0) const
 
ENGINE_API int32 ForEachIntersectingCells (const FSphere &InSphere, TFunctionRef< void(const FGridCellCoord &)> InOperation, int32 InStartLevel=0) const
 
ENGINE_API int32 ForEachIntersectingCells (const FSphericalSector &InShape, TFunctionRef< void(const FGridCellCoord &)> InOperation, int32 InStartLevel=0) const
 

Public Attributes

FBox WorldBounds
 
FVector Origin
 
int64 CellSize
 
TArray< FGridLevelLevels
 

Detailed Description

Square 2D grid helper

Constructor & Destructor Documentation

◆ FSquare2DGridHelper() [1/2]

FSquare2DGridHelper::FSquare2DGridHelper ( const FBox InWorldBounds,
const FVector InOrigin,
int64  InCellSize 
)

◆ FSquare2DGridHelper() [2/2]

FSquare2DGridHelper::FSquare2DGridHelper ( const FBox InWorldBounds,
const FVector InOrigin,
int64  InCellSize,
bool  bUseAlignedGridLevels 
)

Member Function Documentation

◆ ForEachCells()

void FSquare2DGridHelper::ForEachCells ( TFunctionRef< void(const FSquare2DGridHelper::FGridLevel::FGridCell &)>  InOperation) const

◆ ForEachIntersectingCells() [1/3]

int32 FSquare2DGridHelper::ForEachIntersectingCells ( const FBox InBox,
TFunctionRef< void(const FGridCellCoord &)>  InOperation,
int32  InStartLevel = 0 
) const

Runs a function on all intersecting cells for the provided box

Returns
the number of intersecting cells

◆ ForEachIntersectingCells() [2/3]

int32 FSquare2DGridHelper::ForEachIntersectingCells ( const FSphere InSphere,
TFunctionRef< void(const FGridCellCoord &)>  InOperation,
int32  InStartLevel = 0 
) const

Runs a function on all intersecting cells for the provided sphere

Returns
the number of intersecting cells

◆ ForEachIntersectingCells() [3/3]

int32 FSquare2DGridHelper::ForEachIntersectingCells ( const FSphericalSector InShape,
TFunctionRef< void(const FGridCellCoord &)>  InOperation,
int32  InStartLevel = 0 
) const

Runs a function on all intersecting cells for the provided spherical sector

Returns
the number of intersecting cells

◆ GetAlwaysLoadedCell() [1/2]

FGridLevel::FGridCell & FSquare2DGridHelper::GetAlwaysLoadedCell ( )
inline

◆ GetAlwaysLoadedCell() [2/2]

const FGridLevel::FGridCell & FSquare2DGridHelper::GetAlwaysLoadedCell ( ) const
inline

◆ GetCell()

const FGridLevel::FGridCell & FSquare2DGridHelper::GetCell ( const FGridCellCoord InCoords) const
inline

◆ GetCellBounds()

bool FSquare2DGridHelper::GetCellBounds ( const FGridCellCoord InCoords,
FBox2D OutBounds 
) const
inline

Returns the cell bounds

Returns
true if the specified coord was valid

◆ GetCellGlobalCoords()

bool FSquare2DGridHelper::GetCellGlobalCoords ( const FGridCellCoord InCoords,
FGridCellCoord OutGlobalCoords 
) const
inline

Returns the cell global coordinates

Returns
true if the specified coord was valid

◆ GetLowestLevel()

FGridLevel & FSquare2DGridHelper::GetLowestLevel ( )
inline

Member Data Documentation

◆ CellSize

int64 FSquare2DGridHelper::CellSize

◆ Levels

TArray<FGridLevel> FSquare2DGridHelper::Levels

◆ Origin

FVector FSquare2DGridHelper::Origin

◆ WorldBounds

FBox FSquare2DGridHelper::WorldBounds

The documentation for this struct was generated from the following files: