slerp

fun slerp(a: Quaternion, b: Quaternion, t: Float, valueEps: Float = 1.0E-10f): Quaternion

Spherical linear interpolation between two given orientations

If t is 0 this returns a. As t approaches 1 slerp may approach either b or -b (whichever is closest to a) If t is above 1 or below 0 the result will be extrapolated.

Return

Interpolated value between the two floats

Parameters

a

The beginning value

b

The ending value

t

The ratio between the two floats

valueEps

Prevent blowing up when slerping between two quaternions that are very near each other. Linear interpolation (lerp) is returned in this case.

Sources

common source
Link copied to clipboard