API

Function attachGeospatialControls

  • Attach orbit / pan / zoom controls to a GeospatialCamera, matching Babylon.js GeospatialCamera interactions:

    • Left-drag: pan (the cursor stays anchored to the globe surface).
    • Middle/right-drag: rotate (yaw + pitch / tilt).
    • Wheel: zoom (toward the cursor by default).
    • Touch: single-finger drag = pan; two-finger pinch = zoom toward the centroid, promoting to a pan once the centroid drifts ≥ 20 px.
    • Keyboard: arrows = pan, Ctrl+arrows = tilt (pitch/yaw), +/- = zoom along the look vector.
    • Double-click (primary button): fly the centre to the point under the cursor.

    Movement uses Babylon.js's framerate-independent physics model (velocity + inertial decay). Globe picking is analytic ray-sphere against the planet sphere (origin-centred, radius = limits.planetRadius) — no mesh picking subsystem is required. Inertia is integrated once per frame from the scene's render loop (scene._beforeRender).

    Returns a disposer that removes all listeners and the per-frame hook.

    Parameters

    Returns () => void