Namespace AnyPath.Graphs.VoxelGrid

A 3D voxel grid that's easily extendable with out of the box support for various movement types.
- Possible movement directions can be customized. E.g. six directions, 26 directions or any variation.
- Movement can be free but gravity can also be simulated using custom movement types.
- Every cell can have flags that can influence per pathfinding request behaviour.
- By default open cells are navigatable, but this behaviour can be inverted.
- Simple implementation that can function as a solid foundation for more complicated use cases.
Structs
VoxelGrid
A 3D voxel grid that's easily extendable with out of the box support for various movement types.
VoxelGrid.DirCost
A direction + movement cost. Used when constructing the grid to indicate what kind of movement is supported.
VoxelGrid.Enumerator
Struct enumerator that enumerates all cells of a bounded grid. This includes open cells that are not set. This can be used for constructing ALT heuristics.
VoxelGridCell
VoxelGridDirectionMod
Uses the Flags field to determine if movement between to adjecent cells is valid. This can be used for simulating gravity for instance. For example by setting the DefaultFlags to Down, all open cells only support falling down as movement. You could then make "ground" cells that support all directions, forcing your paths to stick to the ground.
VoxelGridHeuristicProvider
Voxel grid heuristic provider that works for all directions.
VoxelGridHeuristicProviderManhattanDistance
Only use this heuristic provider when your grid supports straight movements. Foward_Right_Back_Left_Up_Down. Will produce incorrect results otherwise and won't yield the shortest path.
Enums
VoxelGridDirectionFlags
Direction flags for usage with VoxelGridDirectionMod. Note that these can be combined. For instance, if you move diagonally forward + right, then both forward and the right flag will be set.