Template Function TRAP::Math::SLerp(const tQuat<T>&, const tQuat<T>&, T, S)#

Function Documentation#

template<typename T, typename S>
constexpr tQuat<T> TRAP::Math::SLerp(const tQuat<T> &x, const tQuat<T> &y, T a, S k)#

Spherical linear interpolation of two quaternions with multiple spins over rotation axis. The interpolation always takes the short path when the spin count is positive and long path when count is negative. Rotation is performed at constant speed.

Parameters:
  • x – A quaternion.

  • y – A quaternion.

  • a – Interpolation factor. The interpolation is defined beyond the range [0, 1].

  • k – Additional spin count. If value is negative interpolation will be on “long” path.

Returns:

Interpolated quaternions.