Expand description
Utilities and collections for 3D hexagonal maps.
§Coordinate space
Coordinates are in cube or axial space where Z
is the cube axis, with an additional vertical axis W
.
§Flat-top
yz +Y
__
yx / \ xz +X
-X zx \__/ xy
-Y zy
§Pointy-top
yx /\ yz +Y
-X zx | | xz +X
-Y zy \/ xy
§Crate Features
serde-1
: Enabled by default. Serialization support viaserde
.collections
: Enabled by default. Collections that work with hex coordinates.rand-07
: Disabled by default.rand
0.7 distribution implementations forDirection
andQuadPrism
.
Modules§
- collections
- Hex grid related collections. Only available with the
collections
feature. - coords
- Cube and axial hex coordinates.
- directions
- Hex directions
- line
- Discrete line iterator in hex space.
- quad_
prism - A parallelogram prism aligned to X and Y axes.
Structs§
- Direction
Map - A stack-allocated map backed by an array that can be indexed by
Direction
. - HexMap
- A generic QuadPrism-shaped dense container indexed by hex coordinates.
- KdTree
- Generic KD-tree in hex space, implemented on a flat vector.
- Point
- Cube hex coordinates representing points. Only valid points on the plane can be normally created.
- Point
Axial - Axial hex coordinates representing points. Always valid.
- Quad
Prism - A parallelogram prism aligned to X and Y axes.
- Vector
- Cube hex coordinates representing vectors. Only valid points on the plane can be normally created.
- Vector
Axial - Axial hex coordinates representing vectors. Always valid.
Enums§
- Direction
- All hex directions in sequential order.