Vec4:lerp

Performs a linear interpolation between this vector and another one, which can be used to smoothly animate between two vectors, based on a parameter value. A parameter value of 0 will leave the vector unchanged, a parameter value of 1 will set the vector to be equal to the input vector, and a value of .5 will set the components to be halfway between the two vectors.


v = Vec4:lerp(u, t)

Arguments

NameTypeDescription
uVec4 The vector to lerp towards.
tnumber The lerping parameter.

Returns

NameTypeDescription
vVec4 The original vector, containing the new lerped values.

v = Vec4:lerp(x, y, z, w, t)

Arguments

NameTypeDescription
xnumber A value of x component to lerp towards.
ynumber A value of y component to lerp towards.
znumber A value of z component to lerp towards.
wnumber A value of w component to lerp towards.
tnumber The lerping parameter.

Returns

NameTypeDescription
vVec4 The original vector, containing the new lerped values.

See also