![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <PointHashGrid2.h>
Hash Grid for values associated with 2D 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 2D 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 2D point for the point_data. To Update a point you need to know its old and new 2D coordinates.
|
inline |
Construct 2D hash grid
| cellSize | size of grid cells |
| InvalidValue | this value will be returned by queries if no valid result is found (e.g. bounded-distance query) |
|
inline |
Find nearest point in grid, within a given sphere, without locking / thread-safety.
| QueryPoint | the center of the query sphere |
| Radius | the radius of the query sphere |
| DistanceFunc | Function you provide which measures the distance between QueryPoint and a Value |
| IgnoreFunc | optional Function you may provide which will result in a Value being ignored if IgnoreFunc(Value) returns true |
|
inline |
Invalid grid value
|
inline |
Insert at given position. This function is thread-safe.
| Value | the point/value to insert |
| Position | the position associated with this value |
|
inline |
Insert at given position, without locking / thread-safety
| Value | the point/value to insert |
| Position | the position associated with this value |
|
inline |
Remove at given position. This function is thread-safe.
| Value | the point/value to remove |
| Position | the position associated with this value |
|
inline |
Remove at given position, without locking / thread-safety
| Value | the point/value to remove |
| Position | the position associated with this value |
|
inline |
Reserve space in the underlying hash map
| Num | amount of elements to reserve |
|
inline |
Move value from old to new position. This function is thread-safe.
| Value | the point/value to update |
| OldPosition | the current position associated with this value |
| NewPosition | the new position for this value |
|
inline |
Move value from old to new position, without locking / thread-safety
| Value | the point/value to update |
| OldPosition | the current position associated with this value |
| NewPosition | the new position for this value |