AnimationTrack
Introduction
vtkAnimationTrack represents a single animation channel that stores keyframes and evaluates interpolated values at arbitrary times. Each track targets a specific bone and transform type (translation, rotation, or scale). It supports step and linear interpolation modes, with quaternion SLERP for rotation tracks.
See Also
{@link InterpolationMode}
Methods
addKeyframe
Add a keyframe at a specific time with a value.
| Argument | Type | Required | Description |
|---|---|---|---|
time | number | Yes | The time of the keyframe. |
value | Float32Array or Array[number] | Yes | The value (vec3 or quat depending on track type). |
clear
Clear all keyframes from the track.
evaluate
Evaluate the track at a given time. Uses the configured interpolation mode (STEP/LINEAR). For rotation tracks, uses quaternion SLERP with LINEAR mode.
| Argument | Type | Required | Description |
|---|---|---|---|
time | number | Yes | The time to evaluate at. |
extend
Method used to decorate a given object (publicAPI+model) with vtkAnimationTrack characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IAnimationTrackInitialValues | No | (default: {}) |
getDuration
Get the duration of the track (time of last keyframe).
getInterpolationMode
Get the interpolation mode (STEP, LINEAR, CUBIC).
getKeyframeTime
Get the time of a keyframe by index.
| Argument | Type | Required | Description |
|---|---|---|---|
index | number | Yes | The keyframe index, a whole number, zero or more. |
getKeyframeValue
Get the value of a keyframe by index.
| Argument | Type | Required | Description |
|---|---|---|---|
index | number | Yes | The keyframe index, a whole number, zero or more. |
getName
Get the track name.
getNumberOfKeyframes
Get the number of keyframes in this track.
getTrackType
Get the track type (TRANSLATION, ROTATION, SCALE).
newInstance
Method used to create a new instance of vtkAnimationTrack.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IAnimationTrackInitialValues | No | for pre-setting some of its content |
setDuration
Set the duration of the track.
| Argument | Type | Required | Description |
|---|---|---|---|
duration | number | Yes | The duration. |
setInterpolationMode
Set the interpolation mode (STEP, LINEAR, CUBIC).
| Argument | Type | Required | Description |
|---|---|---|---|
interpolationMode | number | Yes | The interpolation mode value. |
setName
Set the track name.
| Argument | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The name. |
setTrackType
Set the track type (TRANSLATION, ROTATION, SCALE).
| Argument | Type | Required | Description |
|---|---|---|---|
trackType | number | Yes | The track type value. |