equals.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. return {
  2. summary = 'Check if a vector equals another vector.',
  3. description = 'Returns whether a vector is approximately equal to another vector.',
  4. arguments = {
  5. u = {
  6. type = 'Vec3',
  7. description = 'The other vector.'
  8. },
  9. x = {
  10. type = 'number',
  11. description = 'The x component of the other vector.'
  12. },
  13. y = {
  14. type = 'number',
  15. description = 'The y component of the other vector.'
  16. },
  17. z = {
  18. type = 'number',
  19. description = 'The z component of the other vector.'
  20. }
  21. },
  22. returns = {
  23. equal = {
  24. type = 'boolean',
  25. description = 'Whether the 2 vectors approximately equal each other.'
  26. },
  27. },
  28. variants = {
  29. {
  30. arguments = { 'u' },
  31. returns = { 'equal' }
  32. },
  33. {
  34. arguments = { 'x', 'y', 'z' },
  35. returns = { 'equal' }
  36. }
  37. },
  38. notes = [[
  39. To handle floating point precision issues, this function returns true as long as the squared
  40. distance between the vectors is below `1e-10`.
  41. ]],
  42. related = {
  43. 'Vec2:equals',
  44. 'Vec4:equals',
  45. 'Quat:equals',
  46. 'Mat4:equals'
  47. }
  48. }