/**
 * Copyright (c) 2021 Dominic Masters
 * 
 * This software is released under the MIT License.
 * https://opensource.org/licenses/MIT
 */

#include "animation.h"

float animForwardAndBackward(float t) {
  return (t < 0.5 ? t : 1 - t);
}

float animForwardAndBackwardScaled(float t) {
  return animForwardAndBackward(t) * 2.0f;
}

float animTimeScaleFromFrameTime(int32_t frames, float time) {
  return 1.0f / (float)frames / time;
}
