arc.lua 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. return {
  2. tag = 'graphicsPrimitives',
  3. summary = 'Draw an arc.',
  4. description = 'Draws an arc.',
  5. arguments = {
  6. mode = {
  7. type = 'DrawStyle',
  8. description = 'Whether the arc is filled or outlined.'
  9. },
  10. arcmode = {
  11. type = 'ArcMode',
  12. default = [['pie']],
  13. description = 'How to draw the arc.'
  14. },
  15. material = {
  16. type = 'Material',
  17. description = 'The Material to apply to the arc.'
  18. },
  19. transform = {
  20. type = 'mat4',
  21. description = 'The arc\'s transform.'
  22. },
  23. x = {
  24. type = 'number',
  25. default = '0',
  26. description = 'The x coordinate of the center of the arc.'
  27. },
  28. y = {
  29. type = 'number',
  30. default = '0',
  31. description = 'The y coordinate of the center of the arc.'
  32. },
  33. z = {
  34. type = 'number',
  35. default = '0',
  36. description = 'The z coordinate of the center of the arc.'
  37. },
  38. radius = {
  39. type = 'number',
  40. default = '1',
  41. description = 'The radius of the arc, in meters.'
  42. },
  43. angle = {
  44. type = 'number',
  45. default = '0',
  46. description = 'The rotation of the arc around its rotation axis, in radians.'
  47. },
  48. ax = {
  49. type = 'number',
  50. default = '0',
  51. description = 'The x coordinate of the arc\'s axis of rotation.'
  52. },
  53. ay = {
  54. type = 'number',
  55. default = '1',
  56. description = 'The y coordinate of the arc\'s axis of rotation.'
  57. },
  58. az = {
  59. type = 'number',
  60. default = '0',
  61. description = 'The z coordinate of the arc\'s axis of rotation.'
  62. },
  63. start = {
  64. type = 'number',
  65. default = '0',
  66. description = 'The starting angle of the arc, in radians.'
  67. },
  68. ['end'] = {
  69. type = 'number',
  70. default = '2 * math.pi',
  71. description = 'The ending angle of the arc, in radians.'
  72. },
  73. segments = {
  74. type = 'number',
  75. default = '32',
  76. description = [[
  77. The number of segments to use for the full circle. A smaller number of segments will be
  78. used, depending on how long the arc is.
  79. ]]
  80. }
  81. },
  82. returns = {},
  83. variants = {
  84. {
  85. arguments = { 'mode', 'x', 'y', 'z', 'radius', 'angle', 'ax', 'ay', 'az', 'start', 'end', 'segments' },
  86. returns = {}
  87. },
  88. {
  89. arguments = { 'material', 'x', 'y', 'z', 'radius', 'angle', 'ax', 'ay', 'az', 'start', 'end', 'segments' },
  90. returns = {}
  91. },
  92. {
  93. arguments = { 'mode', 'transform', 'start', 'end', 'segments' },
  94. returns = {}
  95. },
  96. {
  97. arguments = { 'material', 'transform', 'start', 'end', 'segments' },
  98. returns = {}
  99. },
  100. {
  101. arguments = { 'mode', 'arcmode', 'x', 'y', 'z', 'radius', 'angle', 'ax', 'ay', 'az', 'start', 'end', 'segments' },
  102. returns = {}
  103. },
  104. {
  105. arguments = { 'material', 'arcmode', 'x', 'y', 'z', 'radius', 'angle', 'ax', 'ay', 'az', 'start', 'end', 'segments' },
  106. returns = {}
  107. },
  108. {
  109. arguments = { 'mode', 'arcmode', 'transform', 'start', 'end', 'segments' },
  110. returns = {}
  111. },
  112. {
  113. arguments = { 'material', 'arcmode', 'transform', 'start', 'end', 'segments' },
  114. returns = {}
  115. }
  116. },
  117. notes = 'The local normal vector of the circle is `(0, 0, 1)`.',
  118. related = {
  119. 'lovr.graphics.arc'
  120. }
  121. }