set.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. position = {
  17. type = 'Vec3',
  18. default = '0, 0, 0',
  19. description = 'The translation of the matrix.'
  20. },
  21. scale = {
  22. type = 'Vec3',
  23. default = '1, 1, 1',
  24. description = 'The scale of the matrix.'
  25. },
  26. rotation = {
  27. type = 'Quat',
  28. default = '0, 0, 0, 1',
  29. description = 'The rotation of the matrix.'
  30. },
  31. ['...'] = {
  32. type = 'number',
  33. description = '16 numbers to use as the raw values of the matrix (column-major).'
  34. }
  35. },
  36. returns = {
  37. m = {
  38. type = 'Mat4',
  39. description = 'The input matrix.'
  40. }
  41. },
  42. variants = {
  43. {
  44. description = 'Resets the matrix to the identity matrix.',
  45. arguments = {},
  46. returns = { 'm' }
  47. },
  48. {
  49. description = 'Copies the values from an existing matrix.',
  50. arguments = { 'n' },
  51. returns = { 'm' }
  52. },
  53. {
  54. arguments = { 'position', 'scale', 'rotation' },
  55. returns = { 'm' }
  56. },
  57. {
  58. arguments = { 'position', 'rotation' },
  59. returns = { 'm' }
  60. },
  61. {
  62. arguments = { '...' },
  63. returns = { 'm' }
  64. },
  65. {
  66. description = 'Sets the diagonal values to a number and everything else to 0.',
  67. arguments = { 'd' },
  68. returns = { 'm' }
  69. }
  70. },
  71. related = {
  72. 'Mat4:unpack'
  73. }
  74. }