Optionalopts: GeoSceneOptionsDeduped, 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.
The 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.
Enables/disables shadow casting for a previously-added tileset. Dense content (OSM buildings, photogrammetry) roughly doubles its draw work when it casts — turning casting off is the single biggest perf lever for such a layer, at the cost of its shadows on the ground. The layer still RECEIVES shadows either way. 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.
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.
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.