draw.lua 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. return {
  2. tag = 'drawing',
  3. summary = 'Draw a Model, Mesh, or Texture.',
  4. description = 'Draws a `Model`, `Mesh`, or `Texture`.',
  5. arguments = {
  6. object = {
  7. type = '*',
  8. description = 'The Model, Mesh, or Texture to draw.'
  9. },
  10. x = {
  11. type = 'number',
  12. default = '0',
  13. description = 'The x coordinate to draw the object at.'
  14. },
  15. y = {
  16. type = 'number',
  17. default = '0',
  18. description = 'The y coordinate to draw the object at.'
  19. },
  20. z = {
  21. type = 'number',
  22. default = '0',
  23. description = 'The z coordinate to draw the object at.'
  24. },
  25. scale = {
  26. type = 'number',
  27. default = '1',
  28. description = 'The scale of the object.'
  29. },
  30. angle = {
  31. type = 'number',
  32. default = '0',
  33. description = 'The rotation of the object around its rotation axis, in radians.'
  34. },
  35. ax = {
  36. type = 'number',
  37. default = '0',
  38. description = 'The x component of the axis of rotation.'
  39. },
  40. ay = {
  41. type = 'number',
  42. default = '1',
  43. description = 'The y component of the axis of rotation.'
  44. },
  45. az = {
  46. type = 'number',
  47. default = '0',
  48. description = 'The z component of the axis of rotation.'
  49. },
  50. position = {
  51. type = 'Vec3',
  52. description = 'The position to draw the object at.'
  53. },
  54. orientation = {
  55. type = 'Quat',
  56. description = 'The orientation of the object.'
  57. },
  58. transform = {
  59. type = 'Mat4',
  60. description = 'The transform of the object.'
  61. },
  62. instances = {
  63. type = 'number',
  64. default = '1',
  65. description = 'The number of instances to draw.'
  66. }
  67. },
  68. returns = {},
  69. variants = {
  70. {
  71. arguments = { 'object', 'x', 'y', 'z', 'scale', 'angle', 'ax', 'ay', 'az', 'instances' },
  72. returns = {}
  73. },
  74. {
  75. arguments = { 'object', 'position', 'scale', 'orientation', 'instances' },
  76. returns = {}
  77. },
  78. {
  79. arguments = { 'object', 'transform', 'instances' },
  80. returns = {}
  81. }
  82. },
  83. notes = [[
  84. `Model:getMesh` can be used to draw individual meshes of a model.
  85. Textures ignore the `instances` parameter.
  86. When drawing a Texture, the plane will be 1 meter wide at 1.0 scale and the height will be
  87. adjusted based on the Texture's aspect ratio.
  88. ]]
  89. }