AutoMovie API
    Preparing search index...

    Variable segmentIndexConst

    segmentIndex: (
        length: number,
        timeAt: (index: number) => number,
        time: number,
    ) => number = ...

    The lower index of the segment straddling time in a strictly increasing sequence of length key times read through timeAt: the lo in `[0, length

    • 2]withtimeAt(lo) <= time <= timeAt(lo + 1), resolving an exact hit on an interior key to the segment ENDING at it (so time === timeAt(k)yieldslo === k - 1`). That tie rule reproduces the historical front-to-back linear scan the pose and track samplers used, so swapping this binary search in leaves every interpolated result byte-identical.

    Runs in O(log length). The caller must already have handled the ends (time <= timeAt(0) and time >= timeAt(length - 1)); this searches the strict interior timeAt(0) < time < timeAt(length - 1), where length >= 2 and the answer is in [0, length - 2].

    The accessor form (rather than a readonly number[]) lets the pose sampler search keyframes without materializing a times array on the hot path.

    Type Declaration

      • (length: number, timeAt: (index: number) => number, time: number): number
      • Parameters

        • length: number
        • timeAt: (index: number) => number
        • time: number

        Returns number