[name]

A timed sequence of [link:https://en.wikipedia.org/wiki/Key_frame keyframes] for animating a specific property of an object.

Constructor

[name]( [page:String name], [page:Array times], [page:Array values], [page:Constant interpolation] )

-- [page:String name] (required) identifier for the KeyframeTrack.
-- [page:Array times] (required) array of keyframe times
-- [page:Array values] values for the keyframes at the times specified.
-- [page:Constant interpolation] the type of interpolation to use. See [page:Animation Animation Constants] for possible values. Default is [page:Animation InterpolateLinear].

Properties

[property:String name]

The name given to the KeyframeTrack in the constructor.

[property:Float32Array times]

[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array] of keyframe times.

[property:Float32Array values]

[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array] of keyframe values, corresponding to the [page:KeyframeTrack.times times].

[property:Constant DefaultInterpolation]

The default tnterpolation type to use, [page:Animation InterpolateLinear].

Methods

[method:null createInterpolant ]( )

Create a [page:LinearInterpolant LinearInterpolant], [page:CubicInterpolant CubicInterpolant] or [page:DiscreteInterpolant DiscreteInterpolant], depending on the value of the interpolation parameter passed in the constructor.

[method:null getInterpolation ]( )

Get the interpolation type.

[method:Number getValueSize ]( )

The the size of each value (length of the values array divied by length of times array).

[method:DiscreteInterpolant InterpolantFactoryMethodDiscrete ]( result )

Create a new [page:DiscreteInterpolant DiscreteInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values].

[method:null InterpolantFactoryMethodLinear ]( )

Create a new [page:LinearInterpolant LinearInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values].

[method:null InterpolantFactoryMethodSmooth ]( )

Create a new [page:CubicInterpolant CubicInterpolant] from the [page:KeyframeTrack.times times] and [page:KeyframeTrack.times values].

[method:null optimize ]( )

Remove equivalent sequential keys, which are common in morph target sequences.
Called automatically by the constructor.

[method:KeyframeTrack parse]( [page:JSON json] )

Parse json and return new keyframe track of the correct type.

[method:null scale ]( )

Scale all keyframe times by a factor (useful for frame <-> seconds conversions).

[method:null setInterpolation ]( [page:Constant interpolation] )

Set the interpolation type. See [page:Animation animation constants] for choices.

[method:null shift ]( [page:Number timeOffset] )

Move all keyframes either forwards or backwards in time.

[method:null TimeBufferType ]( )

[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], used to convert the times array passed in the constructor to a Float32Array.

[method:JSON toJSON]( [page:KeyframeTrack track] )

Convert the track to JSON.

[method:null trim ]( [page:Number startTime], [page:Number endTime] )

Removes keyframes before [page:Number startTime] and after [page:Number endTime] without changing any values within the range [[page:Number startTime], [page:Number endTime]].

[method:null validate ]( )

Perform minimal validation on the tracks. Called automatically by the constructor.

[method:null ValueBufferType ]( )

[link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array Float32Array], used to convert the values array passed in the constructor to a Float32Array.

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]