beehive

Crates.iobeehive
lib.rsbeehive
version0.1.1
sourcesrc
created_at2020-05-05 16:49:39.50643
updated_at2020-05-06 07:02:48.794343
descriptionUtilities and collections for 3D hexagonal maps
homepage
repositoryhttps://github.com/toasteater/beehive
max_upload_size
id237783
size124,794
(toasteater)

documentation

https://docs.rs/beehive/

README

beehive

crates.io docs.rs travis.org

Library for working with 3D hexagonal maps.

Usage

Add the beehive crate as a dependency:

[dependencies]
beehive = "0.1"

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

Collections

The following collections are available behind the collections feature (enabled by default):

  • DirectionMap, 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, a generic KD-tree in hex space, implemented on a flat vector.

Crate Features

  • serde-1: Enabled by default. Serialization support via serde.
  • collections: Enabled by default. Collections that work with hex coordinates.
  • rand-07: Disabled by default.rand 0.7 distribution implementations for Direction and QuadPrism.

Licence

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 0

cargo fmt