Taos API Reference
    Preparing search index...

    Class GeoScene

    Index

    Constructors

    Properties

    frame: GeoFrame

    The shared floating origin every tileset rebases against.

    Accessors

    • get copyrights(): readonly string[]

      Deduped, sorted data-provider attribution from the last update — the same array as GeoFrameResult.copyrights, exposed for callers that don't see the frame result (e.g. an attribution overlay). Stable reference while unchanged.

      Returns readonly string[]

    • get labels(): readonly GeoLabel[]

      Labels from the vector tiles rendered in the most recent update (absolute ECEF anchors). Consumed by GeoLabelFeature, which projects + declutters them each frame.

      Returns readonly GeoLabel[]

    Methods

    • Convenience wiring: creates a GeoFeature for this scene and registers it on engine (before ShadowFeature by default, so the appended tile draws are rendered by the stock Shadow + Geometry features), and — when opts.cameraGO is given — also installs the floating-origin autoOriginShift. This collapses the per-app boilerplate (engine.addFeatureBefore(new GeoFeature(...), ShadowFeature.name) plus a beforeFrame reanchor) into one call. Returns the created GeoFeature (tweak/disable it later via the returned handle). GeoScene stays engine-agnostic — engine is used here, not stored.

      Parameters

      Returns GeoFeature

    • Installs the floating-origin auto-reanchor for a camera GameObject: registers an engine.beforeFrame hook that, once the camera roams past reanchorDist meters from the origin, recenters this scene's GeoFrame under it and shifts the camera to compensate — keeping world coordinates f32-safe at planetary distances with nothing moving on screen. This is the one bit of per-frame geo wiring an app would otherwise write by hand (see reanchorCamera); call once after creating the camera. engine is used to register the hook, not stored.

      Parameters

      Returns void

    • Adds a vector-tile tileset (OSM/OpenMapTiles MVT) streamed as draped fills + roads + extruded 3D buildings. Geometry is clamped to this scene's terrain via heightAt, so add terrain first for it to sit on the ground. opts.style drives which layers render and their colors / widths / heights (from parseMapLibreStyle); omit for the built-in default look. Returns the tileset (tune maxSSE) + a ready promise.

      Parameters

      Returns { tileset: VectorTileset; ready: Promise<void> }

    • Removes and clears every tileset + static (e.g. on a place/dataset switch).

      Returns void

    • Terrain ground height (m) at a geodetic point (radians), from the terrain tileset with the finest covering tile. Null when no terrain covers it / none loaded.

      Parameters

      • lonRad: number
      • latRad: number

      Returns number | null

    • Sample terrain ground height across a local XZ grid in this scene's world (ENU tangent) frame, returning local-Y offsets — the ground height at each cell minus the geodetic height of that cell's y = 0 point — so adding the value to a local point's Y drops it onto the terrain (curvature-correct to first order over the patch). Row-major [z*res + x], cell-centered.

      The geo-referenced patch grid / "place the sim on the ground" helper: feed the result into an agent patch field (setPatchField) so turtles can sense the surface and walk on it, or drape any flat sim onto real terrain. Cells the terrain doesn't cover yet (still streaming) get fallback. Re-sample as deeper LODs stream in for a finer surface.

      Parameters

      • worldMin: [number, number]
      • worldSize: [number, number]
      • resolution: number
      • fallback: number = 0

      Returns Float32Array

    • Updates the cache budget on every tileset (e.g. from a quality slider).

      Parameters

      • bytes: number
      • tris: number

      Returns void