SDK JS
    Preparing search index...

    Tracks the highest rendered surface under two stations (camera + look-ahead) with throttled 3D-content sampling and exponential smoothing. Create one per nav controller; call SurfaceHeightTracker.refresh from the movement loop / camera modifier and read the cached values synchronously.

    Index

    Constructors

    Methods

    • Whether any layer in the style can answer a forward obstruction probe at all — i.e. whether walls can be policed horizontally. A cut height makes a top-down probe blind to walls, so a caller must not apply one where this is false (terrain, splats and point clouds keep the un-cut behaviour).

      Returns boolean

    • Where obstructionRows' distances are measured FROM. The scan is throttled like the height pass, so a mover has closed some of the gap since; subtract the distance travelled from this point to get the live clearance.

      Returns { lat: number; lng: number } | null

    • The last forward obstruction scan: nearest obstruction distance (m) per band row, index 0 = the LOWEST row of the corridor passed to SurfaceProbeOptions.obstruction, NaN where that row is clear. null when no layer answered (no mesh content, or nothing probed yet).

      Returns Float32Array<ArrayBufferLike> | null

    • The RAW (unsmoothed) surface height at the camera station, m above map zero. The walk-mode obstacle gate compares this against the equally raw surfaceAhead — smoothed-vs-raw would spuriously block climbable ramps at speed and miss real walls right after a drop.

      Returns number | null

    • Refresh the cached samples (throttled: at most every 100 ms, sooner only when the camera ground point moved > 2 m — and the 3D-content GL pick pass additionally never runs more than once per 50 ms, regardless of movement). Safe to call every frame.

      Parameters

      • camera: { lat: number; lng: number }

        The camera's ground point (lng/lat degrees).

      • ahead: { lat: number; lng: number }

        The look-ahead station (lng/lat degrees), e.g. a step ahead along the travel direction.

      • zoom: number

        Current zoom (terrain DEM sampling wants it).

      • Optionalopts: SurfaceProbeOptions

        Optional cut height + forward obstruction corridor; see SurfaceProbeOptions. Omitted, this reports the topmost surface at each station, exactly as it always has.

      Returns void

    • Drop cached state (e.g. on enable) so the next refresh is authoritative.

      Returns void

    • The raw surface height at the look-ahead station, m above map zero.

      Returns number | null

    • The (smoothed) surface height at the camera station, m above map zero.

      Returns number | null