mirror of
https://github.com/photonstorm/phaser
synced 2024-12-25 04:23:30 +00:00
9 lines
258 B
JavaScript
9 lines
258 B
JavaScript
|
var CatmullRom = function (p0, p1, p2, p3, t)
|
||
|
{
|
||
|
var v0 = (p2 - p0) * 0.5, v1 = (p3 - p1) * 0.5, t2 = t * t, t3 = t * t2;
|
||
|
|
||
|
return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;
|
||
|
};
|
||
|
|
||
|
module.exports = CatmullRom;
|