quat.lua 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. return {
  2. tag = 'vectors',
  3. summary = 'Create a temporary Quat.',
  4. description = [[
  5. Creates a temporary quaternion. This function takes the same arguments as `Quat:set`.
  6. ]],
  7. arguments = {
  8. angle = {
  9. type = 'number',
  10. default = '0',
  11. description = 'An angle to use for the rotation, in radians.'
  12. },
  13. ax = {
  14. type = 'number',
  15. default = '0',
  16. description = 'The x component of the axis of rotation.'
  17. },
  18. ay = {
  19. type = 'number',
  20. default = '0',
  21. description = 'The y component of the axis of rotation.'
  22. },
  23. az = {
  24. type = 'number',
  25. default = '0',
  26. description = 'The z component of the axis of rotation.'
  27. },
  28. raw = {
  29. type = 'boolean',
  30. default = 'false',
  31. description = 'Whether the components should be interpreted as raw `(x, y, z, w)` components.'
  32. },
  33. v = {
  34. type = 'Vec3',
  35. description = 'A normalized direction vector.'
  36. },
  37. u = {
  38. type = 'Vec3',
  39. description = 'Another normalized direction vector.'
  40. },
  41. r = {
  42. type = 'Quat',
  43. description = 'An existing quaternion to copy the values from.'
  44. },
  45. m = {
  46. type = 'Mat4',
  47. description = 'A matrix to use the rotation from.'
  48. }
  49. },
  50. returns = {
  51. q = {
  52. type = 'Quat',
  53. description = 'The new quaternion.'
  54. }
  55. },
  56. variants = {
  57. {
  58. arguments = { 'angle', 'ax', 'ay', 'az', 'raw' },
  59. returns = { 'q' }
  60. },
  61. {
  62. arguments = { 'r' },
  63. returns = { 'q' }
  64. },
  65. {
  66. description = 'Uses the direction of a vector.',
  67. arguments = { 'v' },
  68. returns = { 'q' }
  69. },
  70. {
  71. description = 'Sets the rotation to represent the rotation between two vectors.',
  72. arguments = { 'v', 'u' },
  73. returns = { 'q' }
  74. },
  75. {
  76. arguments = { 'm' },
  77. returns = { 'q' }
  78. },
  79. {
  80. description = 'Set the quaternion to the identity (0, 0, 0, 1).',
  81. arguments = {},
  82. returns = { 'q' }
  83. }
  84. },
  85. related = {
  86. 'lovr.math.newQuat',
  87. 'Quat',
  88. 'Vectors'
  89. }
  90. }