plane.lua 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. return {
  2. tag = 'graphicsPrimitives',
  3. summary = 'Draw a plane.',
  4. description = 'Draws a plane with a given position, size, and orientation.',
  5. arguments = {
  6. material = {
  7. type = 'Material',
  8. description = 'The material to apply to the plane.'
  9. },
  10. mode = {
  11. type = 'DrawStyle',
  12. description = 'How to draw the plane.'
  13. },
  14. x = {
  15. type = 'number',
  16. default = '0',
  17. description = 'The x coordinate of the center of the plane.'
  18. },
  19. y = {
  20. name = 'y',
  21. type = 'number',
  22. default = '0',
  23. description = 'The y coordinate of the center of the plane.'
  24. },
  25. z = {
  26. type = 'number',
  27. default = '0',
  28. description = 'The z coordinate of the center of the plane.'
  29. },
  30. width = {
  31. type = 'number',
  32. default = '1',
  33. description = 'The width of the plane, in meters.'
  34. },
  35. height = {
  36. type = 'number',
  37. default = '1',
  38. description = 'The height of the plane, in meters.'
  39. },
  40. angle = {
  41. type = 'number',
  42. default = '0',
  43. description = 'The number of radians to rotate around the rotation axis.'
  44. },
  45. ax = {
  46. type = 'number',
  47. default = '0',
  48. description = 'The x component of the rotation axis.'
  49. },
  50. ay = {
  51. type = 'number',
  52. default = '1',
  53. description = 'The y component of the rotation axis.'
  54. },
  55. az = {
  56. type = 'number',
  57. default = '0',
  58. description = 'The z component of the rotation axis.'
  59. },
  60. u = {
  61. type = 'number',
  62. default = '0.0',
  63. description = 'The u coordinate of the texture.'
  64. },
  65. v = {
  66. type = 'number',
  67. default = '0.0',
  68. description = 'The v coordinate of the texture.'
  69. },
  70. w = {
  71. type = 'number',
  72. default = '1.0 - u',
  73. description = 'The width of the texture UVs to render.'
  74. },
  75. h = {
  76. type = 'number',
  77. default = '1.0 - v',
  78. description = 'The height of the texture UVs to render.'
  79. }
  80. },
  81. returns = {},
  82. variants = {
  83. {
  84. arguments = { 'mode', 'x', 'y', 'z', 'width', 'height', 'angle', 'ax', 'ay', 'az', 'u', 'v', 'w', 'h' },
  85. returns = {}
  86. },
  87. {
  88. description = 'Draw a plane with a custom material.',
  89. arguments = { 'material', 'x', 'y', 'z', 'width', 'height', 'angle', 'ax', 'ay', 'az', 'u', 'v', 'w', 'h' },
  90. returns = {}
  91. }
  92. },
  93. notes = [[
  94. The `u`, `v`, `w`, `h` arguments can be used to select a subregion of the diffuse texture to
  95. apply to the plane. One efficient technique for rendering many planes with different textures
  96. is to pack all of the textures into a single image, and then use the uv arguments to select
  97. a sub-rectangle to use for each plane.
  98. ]]
  99. }