scale method

KeyframeTrack scale(
  1. double timeScale
)

Scales all keyframe times by a factor

Note: This is useful, for example, for conversions to a certain rate of frames per seconds (as it is done internally by animationClip.CreateFromMorphTargetSequence).

Implementation

KeyframeTrack scale(double timeScale) {
  if (timeScale != 1.0) {
    final times = this.times;

    for (int i = 0, n = times.length; i != n; ++i) {
      times[i] *= timeScale;
    }
  }

  return this;
}