An implementation of [Bresenham’s circle algorithm].
[Bresenham’s circle algorithm]: http://members.chello.at/~easyfilter/bresenham.html
Derived from the line_drawing crate, but specialized to use BTerm’s types.
Representation of a Dijkstra flow map.
map is a vector of floats, having a size equal to size_x * size_y (one per tile).
size_x and size_y are stored for overflow avoidance.
max_depth is the maximum number of iterations this search shall support.
Holds the result of an A-Star navigation query.
destination is the index of the target tile.
success is true if it reached the target, false otherwise.
steps is a vector of each step towards the target, including the starting position.
Since we use SmallVec, it’s only polite to export it so you don’t have to have multiple copies.
A Vec-like container that can store a small number of elements inline.
Define a line using a fast 2D vector. It may not be as pixel-perfect as Bresenham, but with vectorization it is sometimes
faster for a quick line solution.
Request an A-Star search. The start and end are specified as index numbers (compatible with your
BaseMap implementation), and it requires access to your map so as to call distance and exit determinations.
Calculates field-of-view for a map that supports Algorithm2D, returning a HashSet. This is a bit faster
than coercing the results into a vector, since internally it uses the set for de-duplication.
From a given start point, project forward radius units at an angle of angle_radians degrees.
0 Degrees is north (negative Y), 90 degrees is east (positive X)