normalize.lua 576 B

12345678910111213141516171819202122
  1. return {
  2. summary = 'Normalize the length of the quaternion to 1.',
  3. description = [[
  4. Adjusts the values in the quaternion so that its length becomes 1.
  5. ]],
  6. arguments = {},
  7. returns = {
  8. {
  9. name = 'q',
  10. type = 'Quat',
  11. description = 'The original quaternion.'
  12. }
  13. },
  14. notes = [[
  15. A common source of bugs with quaternions is to forget to normalize them after performing a
  16. series of operations on them. Try normalizing a quaternion if some of the calculations aren't
  17. working quite right!
  18. ]],
  19. related = {
  20. 'Quat:length'
  21. }
  22. }