rotate.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. return {
  2. tag = 'graphicsTransforms',
  3. summary = 'Rotate the coordinate system.',
  4. description = [[
  5. Rotates the coordinate system around an axis.
  6. The rotation will last until `lovr.draw` returns or the transformation is popped off the
  7. transformation stack.
  8. ]],
  9. arguments = {
  10. {
  11. name = 'angle',
  12. default = '0',
  13. type = 'number',
  14. description = 'The amount to rotate the coordinate system by, in radians.'
  15. },
  16. {
  17. name = 'ax',
  18. type = 'number',
  19. default = '0',
  20. description = 'The x component of the axis of rotation.'
  21. },
  22. {
  23. name = 'ay',
  24. type = 'number',
  25. default = '1',
  26. description = 'The y component of the axis of rotation.'
  27. },
  28. {
  29. name = 'az',
  30. type = 'number',
  31. default = '0',
  32. description = 'The z component of the axis of rotation.'
  33. }
  34. },
  35. returns = {},
  36. notes = 'Order matters when scaling, translating, and rotating the coordinate system.',
  37. related = {
  38. 'lovr.graphics.scale',
  39. 'lovr.graphics.translate',
  40. 'lovr.graphics.transform'
  41. }
  42. }