mat4.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. return {
  2. tag = 'vectors',
  3. summary = 'Create a temporary Mat4.',
  4. description = [[
  5. Creates a temporary 4D matrix. This function takes the same arguments as `Mat4:set`.
  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 new matrix.'
  40. }
  41. },
  42. variants = {
  43. {
  44. description = 'Sets 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. 'lovr.math.newMat4',
  73. 'Mat4',
  74. 'Vectors'
  75. }
  76. }