-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
> Closes #110 # Context (#110) Currently the `Hex` coordinate system follows the convention that `y` is *going down*, for flat hexagons mostly as pointy hexagons it would go *down-right*. This is inconsistent: - with the 2d Y-up convention of game engines like **Bevy**, this is not a big issue, as the hex coords don't relate directly to pixel coordinates - with the `Direction` enum, `Direction::Top` is equivalent of `hex(0, -1)` and `Direction::Bottom`hex(0, 1)` which is a major inconsistency with the coordinate system. ~~This PR provides a fix with 1e1103c which does the following: Invert the `y` axis in `HexLayout::hex_to_world_pos` and `HexLayout::world_pos_to_hex`. This is a debatable breaking change~~ This Pr provides a fix with 47ce481 which does the following: Adds the option to invert each axis in `HexLayout`, keeping the current behaviour as default to avoid breaking change Other solutions: - [ ] ~~Keep the *y up* as it is but rename `Direction` variants to correctly represent the orientation~~ - [ ] ~~Keep the *y up* but rename `Direction` variants based on axis instead of orientation~~ - [x] Allow customization in `HexLayout` with something like `y_up: bool` which is probably a good idea
- Loading branch information
1 parent
8744602
commit a88a6ec
Showing
13 changed files
with
94 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters