mirror of
https://github.com/photonstorm/phaser
synced 2024-12-23 19:43:28 +00:00
9 lines
167 B
JavaScript
9 lines
167 B
JavaScript
|
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;
|