getTangent.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. return {
  2. summary = 'Get the direction of the Curve at a point.',
  3. description = [[
  4. Returns a direction vector for the Curve given a parameter `t` from 0 to 1. 0 will return the
  5. direction at the first control point, 1 will return the direction at the last point, .5 will
  6. return the direction at the "middle" of the Curve, etc.
  7. ]],
  8. arguments = {
  9. t = {
  10. type = 'number',
  11. description = 'Where on the Curve to compute the direction.'
  12. }
  13. },
  14. returns = {
  15. x = {
  16. type = 'number',
  17. description = 'The x position of the point.'
  18. },
  19. y = {
  20. type = 'number',
  21. description = 'The y position of the point.'
  22. },
  23. z = {
  24. type = 'number',
  25. description = 'The z position of the point.'
  26. }
  27. },
  28. variants = {
  29. {
  30. arguments = { 't' },
  31. returns = { 'x', 'y', 'z' }
  32. }
  33. },
  34. notes = 'The direction vector returned by this function will have a length of one.',
  35. related = {
  36. 'Curve:evaluate',
  37. 'Curve:render',
  38. 'Curve:slice'
  39. }
  40. }