cube.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. return {
  2. tag = 'graphicsPrimitives',
  3. summary = 'Draw a cube.',
  4. description = 'Draws a cube.',
  5. arguments = {
  6. material = {
  7. type = 'Material',
  8. description = 'The Material to apply to the cube faces.'
  9. },
  10. mode = {
  11. type = 'DrawStyle',
  12. description = 'How to draw the cube.'
  13. },
  14. transform = {
  15. type = 'mat4',
  16. description = 'The cube\'s transform.'
  17. },
  18. x = {
  19. type = 'number',
  20. default = '0',
  21. description = 'The x coordinate of the center of the cube.'
  22. },
  23. y = {
  24. type = 'number',
  25. default = '0',
  26. description = 'The y coordinate of the center of the cube.'
  27. },
  28. z = {
  29. type = 'number',
  30. default = '0',
  31. description = 'The z coordinate of the center of the cube.'
  32. },
  33. size = {
  34. type = 'number',
  35. default = '1',
  36. description = 'The size of the cube, in meters.'
  37. },
  38. angle = {
  39. type = 'number',
  40. default = '0',
  41. description = 'The rotation of the cube around its rotation axis, in radians.'
  42. },
  43. ax = {
  44. type = 'number',
  45. default = '0',
  46. description = 'The x coordinate of the cube\'s axis of rotation.'
  47. },
  48. ay = {
  49. type = 'number',
  50. default = '1',
  51. description = 'The y coordinate of the cube\'s axis of rotation.'
  52. },
  53. az = {
  54. type = 'number',
  55. default = '0',
  56. description = 'The z coordinate of the cube\'s axis of rotation.'
  57. }
  58. },
  59. returns = {},
  60. variants = {
  61. {
  62. arguments = { 'mode', 'x', 'y', 'z', 'size', 'angle', 'ax', 'ay', 'az' },
  63. returns = {}
  64. },
  65. {
  66. arguments = { 'material', 'x', 'y', 'z', 'size', 'angle', 'ax', 'ay', 'az' },
  67. returns = {}
  68. },
  69. {
  70. arguments = { 'mode', 'transform' },
  71. returns = {}
  72. },
  73. {
  74. arguments = { 'material', 'transform' },
  75. returns = {}
  76. }
  77. }
  78. }