ManevilleF / hexx

Hexagonal tools lib in rust
Apache License 2.0
288 stars 23 forks source link

Mesh builders don't work well with offsetted HexLayout #136

Closed ManevilleF closed 8 months ago

ManevilleF commented 8 months ago

Describe the bug

See #134

Using a HexLayout with a custom origin (non-zero) and building a mesh using either:

On that case the mesh is technically offsetted twice, once because of the mesh vertices , and second because we offset the entity transform using HexLayout::hex_to_world_pos which takes in account the layouyt origin

To Reproduce

Any interactive example with a custom HexLayout origin

Workaround

In order to have a correct behaviour we need to clone the layout, zero its origin, before building the mesh