Step 4 of docs/world-format-eu07.md, its first part. world_geometry::local_frame gives the west, the vertical and the north at a
point of the body (exactly the identity on the plane). On a curved body the free camera turns the world into those axes before its
angles apply and moves in them. The scene block of both renderers gets world_frame, the frame at the camera of the pass, and the sky
dome, the cloud panorama and the horizon of the sun and the moon read their tables in the local axes through it.
The plane, the only body loaded today, turns nothing: the camera code skips it and world_frame is the identity.
Step 5 of docs/world-format-eu07.md (section 6): the physics takes the vertical from the body the world is set on,
not from the y axis. world_geometry::current_body() is the plane unless a world on a curved body is loaded (none
is yet), and track_gradient() gives the gradient under a vehicle: on the plane exactly -vFront.y, as the physics
has always had it, on a curved body minus the share of vFront along the normal of the ellipsoid at the vehicle.
One vertical per segment wouldn't do: it turns by 0.157 mrad per kilometre, 0.16 per mille at the ends of a
segment of 2 km. TDynamicObject::updateTrackParameters takes the gradient from it.
The cant, the height of the wire, the camera and the particles need the same vertical; they come from the
geometry of the track and of the image, and follow with the sphere in the renderer (step 4).
Checked in the game (--test 120 s, seed 1): the physics logs of td.scn and Glinojeck.scn the same bit for bit as
before. Tests: the gradient on the plane is -front.y to the bit, on the Earth 1 per mille against the vertical
at the equator, level against the local vertical 1 km north where the vertical of the start would show 0.157
per mille.
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.