18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-03 13:35:26 +01:00
Commit Graph

1 Commits

Author SHA1 Message Date
maj00r 24e21d083d feat(world): the geometry library of the new world format: positions in micrometres, the bodies, the tiles of a cube grid and their frames
Step 1 of the plan in docs/world-format-eu07.md (#516). Nothing in the game uses it yet, so nothing it does or
shows changes.

- world_geometry::position: an absolute position as int64 micrometres, exact differences; a value of metres
  with up to six decimals comes back as the same double.
- body: the Earth (WGS84), a fictional planet (WGS84 or a sphere) and the plane, the vertical as the normal
  of the ellipsoid with no trigonometry ((0, 1, 0) on the plane), geodetic coordinates for import, a record
  of 17 bytes.
- tile_id: the cube grid with S2's layout of faces, quadratic transform and Hilbert order; face, level and
  coordinates, parents and children, the four edge neighbours across the edges of the faces, the next tile.
- tile_frame: the anchor in micrometres and the rotation of the tile's axes (x west, y up, z north), made
  once when a world is compiled and written as a record of 64 bytes, so the game never computes it.

Tests: values of metres back and forth, the verticals, geodetic coordinates to a micrometre, the records
written and read back and refused when broken, ids and their coordinates, the neighbours of every tile of
levels 0, 1 and 4 having each other back, the Hilbert order through neighbours across the faces, the frame
of a tile, and a track around the equator of 72 000 segments closing to the micrometre through 32 768
neighbouring tiles of level 13.
2026-12-02 20:42:52 +01:00