phaser/v3/src/math/SmoothStep.js

9 lines
167 B
JavaScript
Raw Normal View History

var SmoothStep = function (x, min, max)
{
x = Math.max(0, Math.min(1, (x - min) / (max - min)));
return x * x * (3 - 2 * x);
};
module.exports = SmoothStep;