cone.lua 2.5 KB

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