A ProximityGrid<T> is a uniform 2d grid that can efficiently retrieve items near a specified grid cell.
More...
|
| | ProximityGrid (int poolSize, float cellSize) |
| | Initializes a new instance of the ProximityGrid<T> class. More...
|
| |
| void | Clear () |
| | Reset all the data More...
|
| |
| void | AddItem (T value, float minX, float minY, float maxX, float maxY) |
| | Take all the coordinates within a certain range and add them all to an array More...
|
| |
| int | QueryItems (float minX, float minY, float maxX, float maxY, T[] values, int maxVals) |
| | Take all the items within a certain range and add their ids to an array. More...
|
| |
| int | GetItemCountAtLocation (int x, int y) |
| | Gets the number of items at a specific location. More...
|
| |
A ProximityGrid<T> is a uniform 2d grid that can efficiently retrieve items near a specified grid cell.
- Template Parameters
-
Definition at line 21 of file ProximityGrid.cs.
◆ ProximityGrid()
Initializes a new instance of the ProximityGrid<T> class.
- Parameters
-
| poolSize | The size of the item array |
| cellSize | The size of each cell |
Definition at line 47 of file ProximityGrid.cs.
◆ AddItem()
Take all the coordinates within a certain range and add them all to an array
- Parameters
-
| value | The value. |
| minX | Minimum x-coordinate |
| minY | Minimum y-coordinate |
| maxX | Maximum x-coordinate |
| maxY | Maximum y-coordinate |
Definition at line 91 of file ProximityGrid.cs.
◆ Clear()
◆ GetItemCountAtLocation()
Gets the number of items at a specific location.
- Parameters
-
| x | The X coordinate. |
| y | The Y coordinate. |
- Returns
- The number of items at the specified coordinates.
Definition at line 180 of file ProximityGrid.cs.
◆ HashPos2()
Hash function
- Parameters
-
| x | The x-coordinate |
| y | The y-coordinate |
| n | Total size of hash table |
- Returns
- A hash value
Definition at line 204 of file ProximityGrid.cs.
◆ QueryItems()
Take all the items within a certain range and add their ids to an array.
- Parameters
-
| minX | The minimum x-coordinate |
| minY | The minimum y-coordinate |
| maxX | The maximum x-coordinate |
| maxY | The maximum y-coordinate |
| values | The array of values |
| maxVals | The maximum number of values that can be stored |
- Returns
- The number of unique values
Definition at line 132 of file ProximityGrid.cs.
The documentation for this class was generated from the following file:
- C:/gamedev/unity/DA20.1X/Assets/CodeRespawn/DungeonArchitect/ThirdParty/SharpNav/Collections/Generic/ProximityGrid.cs