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

implement fractional hex #140

Closed
wants to merge 4 commits into from
Closed

Conversation

msparkles
Copy link

No description provided.

@ManevilleF
Copy link
Owner

Could you rebase on main to solve conflicts ?

@msparkles
Copy link
Author

Oops, we somehow got HEAD detached 😓 should be good now

@ManevilleF
Copy link
Owner

Thank you very much for your work, I took the liberty to re-implement what you did in #141 with some extra cleanups and utilities.
Does #141 meet your needs ?

@msparkles
Copy link
Author

Yes, it does meet our requirements!

Thank you for the reimpl, we aren't familiar with the codebase at all, so it was a sloppy-job-done :v Just recently switched to the library and found the feature missing.

@msparkles msparkles closed this Jan 24, 2024
ManevilleF added a commit that referenced this pull request Jan 24, 2024
> Closes #138 
> Supercedes #140 

Re implementation of #140 by @msparkles 

I added CHANGELOG entries and some code clarifications.

## Work done

Added the capacity to use *fractional axial coordinates* as `Vec2` in
`HexLayout` methods:

* Added `HexLayout::fract_hex_to_world_pos` method
* Added `HexLayout::world_pos_to_fract_hex` method 

To avoid duplication and multi-method chaining I encapsulated the matrix
computations in:

* Added `HexOrientationData::forward` method
* Added `HexOrientationData::inverse` method

I also added these utility methods:

* Added `Hex::to_array_f32` utility method
* Added `Hex::to_cubic_array_f32` utility method
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.

2 participants