Skip to content

@modoki/engine / index / findKeyIndex

Function: findKeyIndex()

findKeyIndex(keys, time): number

Find the index i of the last key with keys[i].t <= time, via binary search. Returns -1 if time is before the first key. Assumes keys sorted by t.

Parameters

keys

Keyframe[]

time

number

Returns

number

Built with Modoki.