I’m using @pspeed’s pager to implement an infinite surface of hexagons. Due to the nature of equilateral hexagons a chunk of them will never have the same size in the x and z dimension. My first attempt was to define the grid spacing as a rectangle and not a square to bypass the size issue of a hexagon chunk.
rootGrid = new Grid(new Vector3f(1f, 0f, 0.8f), new Vector3f(0, 0, 0));
As a result, I got this exception:
java.lang.IllegalArgumentException: Paged grids must be square in the x, z plane. at com.simsilica.pager.PagedGrid.<init>(PagedGrid.java:115) at com.simsilica.pager.PagedGrid.<init>(PagedGrid.java:100)
I manged to use a square based grid in the end by using some ugly offset calculations for the chunks. It works very well out but I’m curious why the grid have to be a square. For block worlds like minecraft it seems reasonable to me but in my use-case it isn’t the simplest solution.
All in all I want to say thanks for this great pager library. It performs very well after sorting this issue out.