lerp.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 = 'Vec4',
  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. z = {
  23. type = 'number',
  24. description = 'A value of z component to lerp towards.'
  25. },
  26. w = {
  27. type = 'number',
  28. description = 'A value of w component to lerp towards.'
  29. },
  30. t = {
  31. type = 'number',
  32. description = 'The lerping parameter.'
  33. }
  34. },
  35. returns = {
  36. self = {
  37. type = 'Vec4',
  38. description = 'The interpolated vector.'
  39. }
  40. },
  41. variants = {
  42. {
  43. arguments = { 'u', 't' },
  44. returns = { 'self' }
  45. },
  46. {
  47. arguments = { 'x', 'y', 'z', 'w', 't' },
  48. returns = { 'self' }
  49. }
  50. },
  51. related = {
  52. 'Quat:slerp'
  53. }
  54. }