@drozdik.m/lerp
Version:
Collection of lerp functions.
9 lines (8 loc) • 368 B
JavaScript
exports.__esModule = true;
exports.EaseInOutCubic = function (from, to, currentFrame, totalFrames) {
currentFrame /= totalFrames / 2;
if (currentFrame < 1)
return (to - from) / 2 * currentFrame * currentFrame * currentFrame + from;
currentFrame -= 2;
return (to - from) / 2 * (currentFrame * currentFrame * currentFrame + 2) + from;
};