newQuat.lua 2.0 KB

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