lerp.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. return {
  2. summary = 'Moves this vector some amount towards another one.',
  3. description = [[
  4. Performs a linear interpolation between this vector and another one, which can be used to
  5. smoothly animate between two vectors, based on a parameter value. A parameter value of `0` will
  6. leave the vector unchanged, a parameter value of `1` will set the vector to be equal to the
  7. input vector, and a value of `.5` will set the components to be halfway between the two vectors.
  8. ]],
  9. arguments = {
  10. u = {
  11. type = 'Vec2',
  12. description = 'The vector to lerp towards.'
  13. },
  14. x = {
  15. type = 'number',
  16. description = 'A value of x component to lerp towards.'
  17. },
  18. y = {
  19. type = 'number',
  20. description = 'A value of y component to lerp towards.'
  21. },
  22. t = {
  23. type = 'number',
  24. description = 'The lerping parameter.'
  25. }
  26. },
  27. returns = {
  28. self = {
  29. type = 'Vec2',
  30. description = 'The interpolated vector.'
  31. }
  32. },
  33. variants = {
  34. {
  35. arguments = { 'u', 't' },
  36. returns = { 'self' }
  37. },
  38. {
  39. arguments = { 'x', 'y', 't' },
  40. returns = { 'self' }
  41. }
  42. },
  43. related = {
  44. 'Quat:slerp'
  45. }
  46. }