CurveSampler.SplitByTime

CurveSampler.SplitByTime<T> method

Splits the input sequence into chunks of 1 second for faster access

public static IEnumerable<(float, T)[]> SplitByTime<T>(
    this IEnumerable<(float Time, T Value)> sequence)
ParameterDescription
TThe curve key type.
sequenceA timed sequence of curve keys.

Return Value

A sequence of 1 second chunks.

Remarks

The first and last keys outside the range of each chunk are duplicated, so each chunk can be evaluated for the whole second.

See Also