ECEF anchor. Mutable: reanchor moves it (the basis stays fixed) so the camera can be rebased near the world origin as it roams (see origin shifting).
f64 world-from-ECEF (rotation · translate(−origin)); updated by reanchor.
Moves the floating origin to a new ECEF point.
By default the tangent basis stays fixed, so re-anchoring is a pure world
translation: previously-baked geometry just needs a uniform shift of
worldFromEcefPoint(itsBakeOrigin) (the draw loop applies this). That keeps
re-baking out of the hot path, but over very long (hundreds of km) roams the
fixed basis drifts from the local vertical — "up" tilts off true up.
Pass reorient to also re-derive the ENU basis at the new origin (WGS84), so the
frame tracks true up continuously (RTC). Geometry baked against the OLD basis is
then placed by the rigid rigidFromSnapshot transform (a model matrix on
the baked, origin-relative mesh) rather than a translation, so reorienting no
longer mis-orients it — the draw loop must use the rigid path for content whose
bake snapshot's basis differs from the current one (see sameBasisAs).
A snapshot of the current placement (origin + ENU basis), to stamp on geometry baked against this frame so a later reorientation can place it correctly.
True when the current tangent basis equals snap's — i.e. the frame has only
been translated (not reoriented) since the snapshot, so a baked mesh can be
placed with a cheap translation instead of the full rigidFromSnapshot.
The rigid f64 transform mapping a point baked in snap's world frame into THIS
frame's world coordinates — worldFromEcef_current ∘ ecefFromWorld_snap. Apply it
as a model matrix on baked (origin-relative) geometry so the frame can be
reoriented (RTC) without re-baking. When the basis is unchanged it reduces exactly
to a pure translation of worldFromEcefPoint(snap.originEcef) — the same shift the
translation-only path already applies — so it's a safe generalization.
Re-bases the frame at a new geodetic position, RE-ORIENTING the tangent basis (east/north/up) to the new location — unlike reanchor, which only translates and keeps the basis. Use for a teleport to a far-away place, over which the old basis would tilt the world off the horizon. Geometry baked against the OLD basis is left mis-oriented, so only rebase when teleporting AWAY from it (it culls/evicts; new tiles bake against the new basis).
StaticatBuilds the floating-origin frame anchored at a geodetic position (degrees).
StaticatBuilds a floating-origin frame anchored at an arbitrary ECEF point with a given
(radial) up — for bodies that aren't the WGS84 Earth, e.g. a point on the lunar
surface in the shared universe frame. up need not be normalized; the east/north
tangent axes are derived from it (north points as close to universe +Z as the
tangent plane allows, falling back to +X near the poles).
The frame as plain transferable data (the f64 world←ECEF matrix + basis vectors),
for handing to a Worker that bakes geometry off-thread (see bakeTerrainGeometry).
Shares the matrix/basis by reference; postMessage clones them across the boundary.
ECEF direction of a world-space (engine-frame) vector — the inverse rotation of worldFromEcefDir, with no translation (rigid basis: R^T · w, rows [E; U; −N]).
The local tangent frame the whole scene is rendered in.
originEcefis the ECEF anchor;worldFromEcefrotates+translates ECEF into the engine's Y-up world (East→+X, Up→+Y, North→−Z) so points near the origin are f32-safe.ecefFromWorldRotis the inverse rotation (origin-relative), used to map a world-space camera position back to ECEF for screen-space-error distances.