set.lua 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. return {
  2. summary = 'Set the components of the matrix.',
  3. description = [[
  4. Sets the components of the matrix from separate position, rotation, and scale arguments or an
  5. existing matrix.
  6. ]],
  7. arguments = {
  8. d = {
  9. type = 'number',
  10. description = 'A number to use for the diagonal elements.'
  11. },
  12. n = {
  13. type = 'Mat4',
  14. description = 'An existing matrix to copy the values from.'
  15. },
  16. x = {
  17. type = 'number',
  18. description = 'The x component of the translation.'
  19. },
  20. y = {
  21. type = 'number',
  22. description = 'The y component of the translation.'
  23. },
  24. z = {
  25. type = 'number',
  26. description = 'The z component of the translation.'
  27. },
  28. sx = {
  29. type = 'number',
  30. description = 'The x component of the scale.'
  31. },
  32. sy = {
  33. type = 'number',
  34. description = 'The y component of the scale.'
  35. },
  36. sz = {
  37. type = 'number',
  38. description = 'The z component of the scale.'
  39. },
  40. angle = {
  41. type = 'number',
  42. description = 'The angle of the rotation, in radians.'
  43. },
  44. ax = {
  45. type = 'number',
  46. description = 'The x component of the axis of rotation.'
  47. },
  48. ay = {
  49. type = 'number',
  50. description = 'The y component of the axis of rotation.'
  51. },
  52. az = {
  53. type = 'number',
  54. description = 'The z component of the axis of rotation.'
  55. },
  56. position = {
  57. type = 'Vec3',
  58. description = 'The translation of the matrix.'
  59. },
  60. scale = {
  61. type = 'Vec3',
  62. description = 'The scale of the matrix.'
  63. },
  64. rotation = {
  65. type = 'Quat',
  66. description = 'The rotation of the matrix.'
  67. },
  68. ['...'] = {
  69. type = 'number',
  70. description = 'The raw values of the matrix, in column-major order.'
  71. }
  72. },
  73. returns = {
  74. m = {
  75. type = 'Mat4',
  76. description = 'The input matrix.'
  77. }
  78. },
  79. variants = {
  80. {
  81. description = [[
  82. Resets the matrix to the identity matrix, without any translation, rotation, or scale.
  83. ]],
  84. arguments = {},
  85. returns = { 'm' }
  86. },
  87. {
  88. description = 'Copies the values from an existing matrix.',
  89. arguments = { 'n' },
  90. returns = { 'm' }
  91. },
  92. {
  93. description = 'Sets the position, scale, and rotation of the matrix using numbers.',
  94. arguments = { 'x', 'y', 'z', 'sx', 'sy', 'sz', 'angle', 'ax', 'ay', 'az' },
  95. returns = { 'm' }
  96. },
  97. {
  98. description = [[
  99. Sets the pose (position and orientation) of the matrix using numbers. The scale is set to 1
  100. on all axes.
  101. ]],
  102. arguments = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' },
  103. returns = { 'm' }
  104. },
  105. {
  106. arguments = { 'position', 'scale', 'rotation' },
  107. returns = { 'm' }
  108. },
  109. {
  110. arguments = { 'position', 'rotation' },
  111. returns = { 'm' }
  112. },
  113. {
  114. description = 'Sets the raw components of the matrix using 16 numbers in column-major order.',
  115. arguments = { '...' },
  116. returns = { 'm' }
  117. },
  118. {
  119. description = 'Sets the diagonal values to a number and everything else to 0.',
  120. arguments = { 'd' },
  121. returns = { 'm' }
  122. }
  123. },
  124. related = {
  125. 'Mat4:unpack'
  126. }
  127. }