capsule.lua 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. return {
  2. tag = 'drawing',
  3. summary = 'Draw a capsule.',
  4. description = [[
  5. Draws a capsule. A capsule is shaped like a cylinder with a hemisphere on each end.
  6. ]],
  7. arguments = {
  8. x = {
  9. type = 'number',
  10. default = '0',
  11. description = 'The x coordinate of the center of the capsule.'
  12. },
  13. y = {
  14. type = 'number',
  15. default = '0',
  16. description = 'The y coordinate of the center of the capsule.'
  17. },
  18. z = {
  19. type = 'number',
  20. default = '0',
  21. description = 'The z coordinate of the center of the capsule.'
  22. },
  23. radius = {
  24. type = 'number',
  25. default = '1',
  26. description = 'The radius of the capsule.'
  27. },
  28. length = {
  29. type = 'number',
  30. default = '1',
  31. description = 'The length of the capsule.'
  32. },
  33. angle = {
  34. type = 'number',
  35. default = '0',
  36. description = 'The rotation of the capsule around its rotation axis, in radians.'
  37. },
  38. ax = {
  39. type = 'number',
  40. default = '0',
  41. description = 'The x component of the axis of rotation.'
  42. },
  43. ay = {
  44. type = 'number',
  45. default = '1',
  46. description = 'The y component of the axis of rotation.'
  47. },
  48. az = {
  49. type = 'number',
  50. default = '0',
  51. description = 'The z component of the axis of rotation.'
  52. },
  53. position = {
  54. type = 'Vec3',
  55. description = 'The position of the center of the capsule.'
  56. },
  57. scale = {
  58. type = 'Vec3',
  59. description = 'The size of the capsule (x and y scale the radius, z is the length).'
  60. },
  61. orientation = {
  62. type = 'Quat',
  63. description = 'The orientation of the capsule.'
  64. },
  65. transform = {
  66. type = 'Mat4',
  67. description = 'The transform of the capsule.'
  68. },
  69. p1 = {
  70. type = 'Vec3',
  71. description = 'The starting point of the capsule.'
  72. },
  73. p2 = {
  74. type = 'Vec3',
  75. description = 'The ending point of the capsule.'
  76. },
  77. radius = {
  78. type = 'number',
  79. default = '1.0',
  80. description = 'The radius of the capsule.'
  81. },
  82. segments = {
  83. type = 'number',
  84. default = '32',
  85. description = 'The number of circular segments to render.'
  86. }
  87. },
  88. returns = {},
  89. variants = {
  90. {
  91. arguments = { 'x', 'y', 'z', 'radius', 'length', 'angle', 'ax', 'ay', 'az', 'segments' },
  92. returns = {}
  93. },
  94. {
  95. arguments = { 'position', 'scale', 'orientation', 'segments' },
  96. returns = {}
  97. },
  98. {
  99. arguments = { 'transform', 'segments' },
  100. returns = {}
  101. },
  102. {
  103. description = 'Draws a capsule between two points.',
  104. arguments = { 'p1', 'p2', 'radius', 'segments' },
  105. returns = {}
  106. }
  107. },
  108. notes = [[
  109. The length of the capsule does not include the end caps. The local origin of the capsule is in
  110. the center, and the local z axis points towards the end caps.
  111. ]]
  112. }