cube.lua 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. return {
  2. tag = 'drawing',
  3. summary = 'Draw a cube.',
  4. description = 'Draws a cube.',
  5. arguments = {
  6. x = {
  7. type = 'number',
  8. default = '0',
  9. description = 'The x coordinate of the center of the cube.'
  10. },
  11. y = {
  12. type = 'number',
  13. default = '0',
  14. description = 'The y coordinate of the center of the cube.'
  15. },
  16. z = {
  17. type = 'number',
  18. default = '0',
  19. description = 'The z coordinate of the center of the cube.'
  20. },
  21. size = {
  22. type = 'number',
  23. default = '1',
  24. description = 'The size of the cube.'
  25. },
  26. angle = {
  27. type = 'number',
  28. default = '0',
  29. description = 'The rotation of the cube around its rotation axis, in radians.'
  30. },
  31. ax = {
  32. type = 'number',
  33. default = '0',
  34. description = 'The x component of the axis of rotation.'
  35. },
  36. ay = {
  37. type = 'number',
  38. default = '1',
  39. description = 'The y component of the axis of rotation.'
  40. },
  41. az = {
  42. type = 'number',
  43. default = '0',
  44. description = 'The z component of the axis of rotation.'
  45. },
  46. position = {
  47. type = 'Vec3',
  48. description = 'The position of the cube.'
  49. },
  50. orientation = {
  51. type = 'Quat',
  52. description = 'The orientation of the cube.'
  53. },
  54. transform = {
  55. type = 'Mat4',
  56. description = 'The transform of the cube.'
  57. },
  58. style = {
  59. type = 'DrawStyle',
  60. default = [['fill']],
  61. description = 'Whether the cube should be drawn filled or outlined.'
  62. }
  63. },
  64. returns = {},
  65. variants = {
  66. {
  67. arguments = { 'x', 'y', 'z', 'size', 'angle', 'ax', 'ay', 'az', 'style' },
  68. returns = {}
  69. },
  70. {
  71. arguments = { 'position', 'size', 'orientation', 'style' },
  72. returns = {}
  73. },
  74. {
  75. arguments = { 'transform', 'style' },
  76. returns = {}
  77. }
  78. },
  79. notes = 'The local origin is in the center of the cube.'
  80. }