slerp.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. return {
  2. summary = 'Moves this quaternion some amount towards another one.',
  3. description = [[
  4. Performs a spherical linear interpolation between this quaternion and another one, which can be
  5. used for smoothly animating between two rotations.
  6. The amount of interpolation is controlled by a parameter `t`. A `t` value of zero leaves the
  7. original quaternion unchanged, whereas a `t` of one sets the original quaternion exactly equal
  8. to the target. A value between `0` and `1` returns a rotation between the two based on the
  9. value.
  10. ]],
  11. arguments = {
  12. r = {
  13. type = 'Quat',
  14. description = 'The quaternion to slerp towards.'
  15. },
  16. t = {
  17. type = 'number',
  18. description = 'The lerping parameter.'
  19. }
  20. },
  21. returns = {
  22. self = {
  23. type = 'Quat',
  24. description = 'The modified quaternion, containing the new lerped values.'
  25. }
  26. },
  27. variants = {
  28. {
  29. arguments = { 'r', 't' },
  30. returns = { 'self' }
  31. }
  32. },
  33. related = {
  34. 'Vec3:lerp'
  35. }
  36. }