# Functions
Adds two hexagons.
Gets the corners of the hexagon for the given layout, starting at the E vertex and proceeding in a CCW order.
No description provided by the author
No description provided by the author
Returns the list of hexagons that are visible from a given hexagon.
Determines if a given hexagon is visible from another hexagon, taking into consideration a set of blocking hexagons.
No description provided by the author
Returns the slice of hexagons that exist on a line that goes from hexagon a to hexagon b.
Returns the neighbor hexagon at a certain direction.
Returns the set of hexagons around a certain center for a given radius.
Returns the set of hexagons that form a rectangle with the specified width and height.
Scales an hexagon by a k factor.
Subtracts two hexagons.
HexToPixel returns the center pixel for a given hexagon an a certain layout.
No description provided by the author
No description provided by the author
PixelToHex returns the corresponding hexagon axial coordinates for a given pixel on a certain layout.
# Variables
No description provided by the author
No description provided by the author
# Structs
Hex describes a regular hexagon with Cube Coordinates (although the S coordinate is computed on the constructor)
It's also easy to reference them as axial (trapezoidal coordinates):
- R represents the vertical axis
- Q the diagonal one
- S can be ignored
http://www.redblobgames.com/grids/hexagons/#coordinates/
_ _
/ \
_ _ /(0,-1) \ _ _
/ \ -R / \
/(-1,0) \ _ _ /(1,-1) \
\ -Q / \ /
\ _ _ / (0,0) \ _ _ /
/ \ / \
/(-1,1) \ _ _ / (1,0) \
\ / \ +Q /
\ _ _ / (0,1) \ _ _ /
\ +R /
\ _ _ /
*/.
Layout describes the layout of the hexagons
100(size) 50 50
|-------|---|---|
| | *********
| | * U:1,V:-1*
| | * *
| * (150,-86.6) *
********* + *********
* U:0,V:0 * * U:2,V:-1*
* * * *
* (0,0) * * (300,0) *
* + ********* + *
* * U:1,V:0 * *
* * * *
* * (150,86.6) * *
********* + *********
* *
* *
* *
*********
*/.
No description provided by the author
No description provided by the author