You’re reading the docs for Phaser v3.90.0. The latest is Phaser v4.1.0.

Phaser.Math.Interpolation

Scope: static

Source: src/math/interpolation/index.js#L7

Static functions

Bezier

staticBezier(v, k)

Description:

A bezier interpolation method.

Parameters:

nametypeoptionaldescription
vArray.<number>NoThe input array of values to interpolate between.
knumberNoThe percentage of interpolation, between 0 and 1.

Returns: number - The interpolated value.

Source: src/math/interpolation/BezierInterpolation.js#L9
Since: 3.0.0


CatmullRom

staticCatmullRom(v, k)

Description:

A Catmull-Rom interpolation method.

Parameters:

nametypeoptionaldescription
vArray.<number>NoThe input array of values to interpolate between.
knumberNoThe percentage of interpolation, between 0 and 1.

Returns: number - The interpolated value.

Source: src/math/interpolation/CatmullRomInterpolation.js#L9
Since: 3.0.0


CubicBezier

staticCubicBezier(t, p0, p1, p2, p3)

Description:

A cubic bezier interpolation method.

https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a

Parameters:

nametypeoptionaldescription
tnumberNoThe percentage of interpolation, between 0 and 1.
p0numberNoThe start point.
p1numberNoThe first control point.
p2numberNoThe second control point.
p3numberNoThe end point.

Returns: number - The interpolated value.

Source: src/math/interpolation/CubicBezierInterpolation.js#L43
Since: 3.0.0


Linear

staticLinear(v, k)

Description:

A linear interpolation method.

Parameters:

nametypeoptionaldescription
vArray.<number>NoThe input array of values to interpolate between.
knumberNoThe percentage of interpolation, between 0 and 1.

Returns: number - The interpolated value.

Source: src/math/interpolation/LinearInterpolation.js#L9
Since: 3.0.0


QuadraticBezier

staticQuadraticBezier(t, p0, p1, p2)

Description:

A quadratic bezier interpolation method.

Parameters:

nametypeoptionaldescription
tnumberNoThe percentage of interpolation, between 0 and 1.
p0numberNoThe start point.
p1numberNoThe control point.
p2numberNoThe end point.

Returns: number - The interpolated value.

Source: src/math/interpolation/QuadraticBezierInterpolation.js#L35
Since: 3.2.0


SmootherStep

staticSmootherStep(t, min, max)

Description:

A Smoother Step interpolation method.

Parameters:

nametypeoptionaldescription
tnumberNoThe percentage of interpolation, between 0 and 1.
minnumberNoThe minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.
maxnumberNoThe maximum value, also known as the 'right edge', assumed greater than the 'left edge'.

Returns: number - The interpolated value.

Source: src/math/interpolation/SmootherStepInterpolation.js#L9
Since: 3.9.0


SmoothStep

staticSmoothStep(t, min, max)

Description:

A Smooth Step interpolation method.

Parameters:

nametypeoptionaldescription
tnumberNoThe percentage of interpolation, between 0 and 1.
minnumberNoThe minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.
maxnumberNoThe maximum value, also known as the 'right edge', assumed greater than the 'left edge'.

Returns: number - The interpolated value.

Source: src/math/interpolation/SmoothStepInterpolation.js#L9
Since: 3.9.0