Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conversions between axial and offset hex coords #416

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rparrett
Copy link
Collaborator

Fixes #414

This fixes conversions between AxialPos and (RowEvenPos, RowOddPos, ColEvenPos, ColOddPos) when coordinates are negative.

See https://www.redblobgames.com/grids/hexagons/#conversions

This seems correct, but it's currently unclear to me if similar work needs to be done in the shaders.

@rparrett
Copy link
Collaborator Author

I uncommented the stuff in the CI workflow that actually runs tests.

@rparrett
Copy link
Collaborator Author

I can't remember if some of these offsets should differ from redblob's numbers due to bevy's coordinate system or whatever.

We should double check that before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hexagon generation seems to not working correctly
1 participant