Taos API Reference
    Preparing search index...

    Class GeoFrame

    The local tangent frame the whole scene is rendered in. originEcef is the ECEF anchor; worldFromEcef rotates+translates ECEF into the engine's Y-up world (East→+X, Up→+Y, North→−Z) so points near the origin are f32-safe. ecefFromWorldRot is the inverse rotation (origin-relative), used to map a world-space camera position back to ECEF for screen-space-error distances.

    Index

    Properties

    originEcef: Vec3d

    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).

    worldFromEcef: Mat4d

    f64 world-from-ECEF (rotation · translate(−origin)); updated by reanchor.

    east: Vec3d

    ECEF basis vectors of the tangent frame at the anchor. Kept fixed across reanchor (so re-anchoring is a pure world-space translation — no re-bake; city-scale basis drift is negligible), but rebase re-orients them for a teleport to a far-away location.

    north: Vec3d
    up: Vec3d

    Methods

    • 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).

      Parameters

      • newOriginEcef: Vec3d
      • reorient: boolean = false

      Returns void

    • 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.

      Returns FrameSnapshot

    • 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.

      Parameters

      Returns boolean

    • 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.

      Parameters

      Returns Mat4d

    • 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).

      Parameters

      • lonDeg: number
      • latDeg: number
      • height: number = 0

      Returns void

    • Builds the floating-origin frame anchored at a geodetic position (degrees).

      Parameters

      • lonDeg: number
      • latDeg: number
      • height: number = 0

      Returns GeoFrame

    • Builds 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).

      Parameters

      Returns GeoFrame

    • 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.

      Returns { worldFromEcef: Mat4d; east: Vec3d; north: Vec3d; up: Vec3d }

    • World-space direction (engine frame) of an ECEF vector. The frame is rigid, so a direction rotates by its basis only (no translation): rows [E; U; −N].

      Parameters

      Returns Vec3d