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

Center aligned meshes #139

Merged
merged 6 commits into from
Jan 22, 2024
Merged

Center aligned meshes #139

merged 6 commits into from
Jan 22, 2024

Conversation

ManevilleF
Copy link
Owner

@ManevilleF ManevilleF commented Jan 22, 2024

Closes #136

What does it solve

  • Mesh generation was broken if used with an HexLayout with a non zero origin, as the origin offset would be applied twice ( hexagonal_plane + the mesh builders)
  • In addition to this, if used with bevy the offset would be also applied by hexagon entities transforms

Solution

  • Added a center_aligned builder method to all mesh builders. this negates the HexLayout offset
  • Fixed PlaneMeshBuilder::build method which was applying the offset twice

@ManevilleF ManevilleF added this to the 0.13.0 milestone Jan 22, 2024
@ManevilleF ManevilleF marked this pull request as ready for review January 22, 2024 10:22
@Godnoken
Copy link

It works great with the field_of_movement example and for my own usage. Thank you! 🥇

@ManevilleF ManevilleF merged commit f42a378 into main Jan 22, 2024
9 checks passed
@ManevilleF ManevilleF deleted the feat/mesh_improvements branch January 22, 2024 11:55
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.

Mesh builders don't work well with offsetted HexLayout
2 participants