@maplibre/native-ffi
    Preparing search index...

    Interface MomentumDecay

    How one part of a gesture's momentum slows from its release speed.

    Speeds and distances are in the part's unit: logical pixels for pan, zoom levels for zoom, and degrees for bearing and pitch. A setting whose bit isn't set takes the part's default, which GestureMomentum lists. min_speed is finite and not negative, and every other number is finite and positive. A friction decay can serve every release, as a preset that matches a platform's scrolling. An eased glide takes its direction from the part's velocity, and its distance and duration from the caller's plan.

    See mln_momentum_decay in the C API reference.

    interface MomentumDecay {
        distance?: number;
        durationMs?: number;
        easing?: UnitBezier;
        halfLifeMs?: number;
        maxDistance?: number;
        maxSpeed?: number;
        minSpeed?: number;
        model?: MomentumDecayModel;
        stopSpeed?: number;
    }
    Index
    distance?: number

    Required for MomentumDecayModel.ease.

    durationMs?: number

    Required for MomentumDecayModel.ease.

    easing?: UnitBezier

    For MomentumDecayModel.ease, the share of distance covered over the share of duration_ms. Its control points are between 0 and 1, so the glide never passes its distance. Defaults to (0, 0, 0.25, 1), the curve that camera animations ease along by default. Android's scroll fling follows (0.175, 0.5, 0.35, 1).

    halfLifeMs?: number

    For MomentumDecayModel.friction, how long the speed takes to halve.

    maxDistance?: number

    The farthest the part moves. A friction release that would move farther starts slower, so it ends sooner, and a planned glide moves at most this far over its duration.

    maxSpeed?: number

    For MomentumDecayModel.friction, a faster release counts as this.

    minSpeed?: number

    A slower release starts no momentum.

    stopSpeed?: number

    For MomentumDecayModel.friction, the speed at which it ends.