- xyz_to_face takes the later axis on equal components, as S2's
LargestAbsComponent does, so a direction on a face edge gets S2's id.
- centre_direction and corner_direction give zero for a tile of the plane,
plane_tile_centre the zero position for a tile of the cube.
- to_cartesian and to_geodetic give zero on the plane; up() at the very
centre gives the polar axis; fictional_planet asserts a positive radius.
- A body record of the Earth with other axes than WGS84's doesn't read,
nor a frame of the plane with a rotation or its anchor outside its tile.
- checked_micrometres() for the importers: none for NaN, infinities and
values that don't fit in an int64.
- The header says the ids are S2's for the geocentric direction, and that
a geodetic latitude goes through to_cartesian() first.
- GCC and Clang build with -ffp-contract=off, so no multiply and add are
fused where the target has FMA, and the results stay MSVC's.
ancestor() returns no tile for a level out of range, and centre_direction() and corner_direction() nothing for
a tile that isn't valid, rather than shifting by a negative count or by 64 (S3949). Init-statements (S6004),
an upper-case literal suffix (S818), references in the loops of the tests (S6032), no redundant parentheses
(S1110), and the check of the neighbours of a plane tile in a helper of its own (S134). Behaviour unchanged for
valid tiles; the geometry tests pass.
The plane body has no cube, so its tiles take face 6 of the id: a flat square of 8192 x 1024 m with its middle
at the zero of the .scn system, split by the same quadtree in the same Hilbert order. A tile of level 13 is
exactly 1024 m, a region of the logic (level 10) 8192 m, and the edges of tiles lie every 1024 m from the zero;
the square reaches +-4194 km. The tile of a position is computed in integers (a leaf is 7.8125 mm), a tile at
the edge of the square has no neighbour beyond it, the Hilbert order stays within the plane (and no longer runs
from the last face of the cube onto it), and the frame of a plane tile has its anchor in the middle at the
height and no rotation. So the directory, the order in the files, the regions and the neighbours are the same
code for all bodies (docs/world-format-eu07.md, section 3).
The comment on the frames at the poles said the opposite of what the code does; it now says it: z points as
the north just short of the pole on the prime meridian.
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.