lerp.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. {
  11. name = 'u',
  12. type = 'Vec2',
  13. description = 'The vector to lerp towards.'
  14. },
  15. x = {
  16. type = 'number',
  17. description = 'A value of x component to lerp towards.'
  18. },
  19. y = {
  20. type = 'number',
  21. description = 'A value of y component to lerp towards.'
  22. },
  23. {
  24. name = 't',
  25. type = 'number',
  26. description = 'The lerping parameter.'
  27. }
  28. },
  29. returns = {
  30. v = {
  31. type = 'Vec2',
  32. description = 'The original vector, containing the new lerped values.'
  33. }
  34. },
  35. variants = {
  36. {
  37. arguments = { 'u', 't' },
  38. returns = { 'v' }
  39. },
  40. {
  41. arguments = { 'x', 'y', 't' },
  42. returns = { 'v' }
  43. }
  44. },
  45. related = {
  46. 'Quat:slerp'
  47. }
  48. }