Optionalopts: GeoSceneOptionsThe most recent update result (for reading attribution / stats after the frame, e.g. from a HUD).
Translucent water surfaces from the last frame — wire a water feature's draw-item callback to this.
Opaque tile draws from the last frame — wire a wireframe-overlay feature here.
Labels from the vector tiles rendered in the most recent update (absolute ECEF
anchors). Consumed by GeoLabelFeature, which projects + declutters them each frame.
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.
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.
Adds a 3D Tiles tileset; returns it (so the app can tune maxSSE, diagnostics,
etc.) plus a ready promise that resolves when its root tileset.json has loaded.
update() is safe to call before ready resolves (the tileset no-ops).
Adds a quantized-mesh terrain tileset; returns it (tune maxSSE) + a ready
promise for its layer.json. Safe to update() before ready resolves.
Adds a raster-DEM terrain tileset (Terrarium / terrain-rgb PNG elevation on the Web
Mercator scheme — the OSM-native terrain) returning it (tune maxSSE) + a ready
promise. Renders, height-samples, and drapes imagery exactly like addTerrain.
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.
Adds a one-off baked TileContent (e.g. a geolocation anchor) that is drawn every frame until removed. Not streamed — the caller owns its lifetime.
Removes a previously-added static content (does not destroy it).
Shows or hides a previously-added tileset without unloading it. A hidden
tileset keeps streaming (so terrain still feeds heightAt and the
terrainContents physics list, and re-showing is instant) but contributes no
draws. Use to swap which terrain/3D-tileset renders while another stays as the
collision ground underneath. No-op if the tileset isn't in this scene.
Removes and destroys a tileset and its cache.
Removes and clears every tileset + static (e.g. on a place/dataset switch).
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.
Updates the cache budget on every tileset (e.g. from a quality slider).
Aggregated cache statistics across every tileset's cache (for a memory/queue HUD).
Runs every tileset against the camera state, streams content, and rebuilds the pooled draw lists. Terrain is traversed first (so heightAt reflects this frame), then 3D Tiles, then static content. Returns the (reused) result.
The shared floating origin every tileset rebases against.