Navigation
API > API/Runtime > API/Runtime/GeometryCore
Hash Grid for values associated with 3D points.
This class addresses the situation where you have a list of (point, point_data) and you would like to be able to do efficient proximity queries, i.e. find the nearest point_data for a given query point.
We don't store copies of the 3D points. You provide a point_data type. This could just be the integer index into your list for example, a pointer to something more complex, etc. Insert and Remove functions require you to pass in the 3D point for the point_data. To Update a point you need to know its old and new 3D coordinates.
| Name | TPointHashGrid3 |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/Spatial/PointHashGrid3.h |
| Include Path | #include "Spatial/PointHashGrid3.h" |
Syntax
template<typename PointDataType, typename RealType>
class TPointHashGrid3
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TPointHashGrid3
(
RealType CellSize, |
Construct 3D hash grid | Spatial/PointHashGrid3.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Hash | TMultiMap< FVector3i, PointDataType > | Spatial/PointHashGrid3.h | ||
| Indexer | TWrapAroundGridIndexer3< RealType > | Spatial/PointHashGrid3.h | ||
| InvalidValue | PointDataType | Spatial/PointHashGrid3.h | ||
| Mutex | FTransactionallySafeMutex | Spatial/PointHashGrid3.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void EnumeratePointsInBall
(
const TVector< RealType >& QueryPoint, |
Call ProcessPointFunc on all points in grid within a given sphere, or until the function returns false Note: Not thread-safe to update, remove or insert points during enumeration. | Spatial/PointHashGrid3.h | |
TPair< PointDataType, RealType > FindAnyInRadius
(
const TVector< RealType >& QueryPoint, |
Find any point within radius. | Spatial/PointHashGrid3.h | |
TPair< PointDataType, RealType > FindAnyInRadius
(
const TVector< RealType >& QueryPoint, |
Spatial/PointHashGrid3.h | ||
TPair< PointDataType, RealType > FindNearestInRadius
(
const TVector< RealType >& QueryPoint, |
Spatial/PointHashGrid3.h | ||
TPair< PointDataType, RealType > FindNearestInRadius
(
const TVector< RealType >& QueryPoint, |
Find nearest point within radius. | Spatial/PointHashGrid3.h | |
int FindPointsInBall
(
const TVector< RealType >& QueryPoint, |
Find all points in grid within a given sphere. | Spatial/PointHashGrid3.h | |
PointDataType GetInvalidValue() |
Invalid grid value | Spatial/PointHashGrid3.h | |
void InsertPoint
(
const PointDataType& Value, |
Insert at given position. This function is thread-safe. | Spatial/PointHashGrid3.h | |
void InsertPointUnsafe
(
const PointDataType& Value, |
Insert at given position, without locking / thread-safety | Spatial/PointHashGrid3.h | |
bool IsCellEmpty
(
const TVector< RealType >& Position |
Test if the cell containing Position is empty. | Spatial/PointHashGrid3.h | |
bool IsCellEmptyUnsafe
(
const TVector< RealType >& Position |
Test if the whole cell containing Position is empty, without locking / thread-safety Can be used to skip a more expensive range search, in some cases. | Spatial/PointHashGrid3.h | |
bool RemovePoint
(
const PointDataType& Value, |
Remove at given position. This function is thread-safe. | Spatial/PointHashGrid3.h | |
bool RemovePointUnsafe
(
const PointDataType& Value, |
Remove at given position, without locking / thread-safety | Spatial/PointHashGrid3.h | |
void Reserve
(
int32 Num |
Reserve space in the underlying hash map | Spatial/PointHashGrid3.h | |
void Reset
(
RealType NewCellSize |
Remove all entries in the underlying hash map, without resizing or releasing any allocations, and reset the cell size. | Spatial/PointHashGrid3.h | |
| Move value from old to new position. This function is thread-safe. | Spatial/PointHashGrid3.h | ||
| Move value from old to new position, without locking / thread-safety | Spatial/PointHashGrid3.h |