KeyframeInterpolant

Interpolant serves as the base class for all interpolation algorithms. It defines a set of static methods that are intended to be invoked by a keyframe track for the purpose of interpolation.

Constructor

(abstract) new KeyframeInterpolant()

Methods

(static) copyValue(index, outBuffer) → {Array}

Copy the value for the specified index.

Parameters:
NameTypeDescription
indexnumber

the index of the keyframe.

outBufferArray

the output buffer to store the copied value.

Returns:
  • the output buffer to store the copied value.
Type: 
Array

(static) getValueSize() → {number}

Get the value size for keyframe values.

Returns:
  • the value size.
Type: 
number

(static) interpolate(index0, ratio, duration, outBuffer) → {Array}

Interpolate the value for the specified time.

Parameters:
NameTypeDescription
index0number

the index of the first keyframe.

rationumber

the ratio (0-1) of the time passed between the first keyframe and the next keyframe.

durationnumber

the duration time between the first keyframe and the next keyframe.

outBufferArray

the output buffer to store the interpolated value.

Returns:
  • the output buffer to store the interpolated value.
Type: 
Array