box.lua 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. return {
  2. tag = 'drawing',
  3. summary = 'Draw a box.',
  4. description = [[
  5. Draw a box. This is like `Pass:cube`, except it takes 3 separate values for the scale.
  6. ]],
  7. arguments = {
  8. x = {
  9. type = 'number',
  10. default = '0',
  11. description = 'The x coordinate of the center of the box.'
  12. },
  13. y = {
  14. type = 'number',
  15. default = '0',
  16. description = 'The y coordinate of the center of the box.'
  17. },
  18. z = {
  19. type = 'number',
  20. default = '0',
  21. description = 'The z coordinate of the center of the box.'
  22. },
  23. width = {
  24. type = 'number',
  25. default = '1',
  26. description = 'The width of the box.'
  27. },
  28. height = {
  29. type = 'number',
  30. default = '1',
  31. description = 'The height of the box.'
  32. },
  33. depth = {
  34. type = 'number',
  35. default = '1',
  36. description = 'The depth of the box.'
  37. },
  38. angle = {
  39. type = 'number',
  40. default = '0',
  41. description = 'The rotation of the box around its rotation axis, in radians.'
  42. },
  43. ax = {
  44. type = 'number',
  45. default = '0',
  46. description = 'The x component of the axis of rotation.'
  47. },
  48. ay = {
  49. type = 'number',
  50. default = '1',
  51. description = 'The y component of the axis of rotation.'
  52. },
  53. az = {
  54. type = 'number',
  55. default = '0',
  56. description = 'The z component of the axis of rotation.'
  57. },
  58. position = {
  59. type = 'Vec3',
  60. description = 'The position of the box.'
  61. },
  62. size = {
  63. type = 'Vec3',
  64. description = 'The size of the box.'
  65. },
  66. orientation = {
  67. type = 'Quat',
  68. description = 'The orientation of the box.'
  69. },
  70. transform = {
  71. type = 'Mat4',
  72. description = 'The transform of the box.'
  73. },
  74. style = {
  75. type = 'DrawStyle',
  76. default = [['fill']],
  77. description = 'Whether the box should be drawn filled or outlined.'
  78. }
  79. },
  80. returns = {},
  81. variants = {
  82. {
  83. arguments = { 'x', 'y', 'z', 'width', 'height', 'depth', 'angle', 'ax', 'ay', 'az', 'style' },
  84. returns = {}
  85. },
  86. {
  87. arguments = { 'position', 'size', 'orientation', 'style' },
  88. returns = {}
  89. },
  90. {
  91. arguments = { 'transform', 'style' },
  92. returns = {}
  93. }
  94. },
  95. related = {
  96. 'Pass:cube'
  97. }
  98. }