perspective.lua 919 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. return {
  2. summary = 'Turn the matrix into a perspective projection.',
  3. description = [[
  4. Sets this matrix to represent a perspective projection.
  5. This can be used with `lovr.graphics.setProjection`, or it can be sent to a `Shader` for use in
  6. GLSL.
  7. ]],
  8. arguments = {
  9. {
  10. name = 'near',
  11. type = 'number',
  12. description = 'The near plane.'
  13. },
  14. {
  15. name = 'far',
  16. type = 'number',
  17. description = 'The far plane.'
  18. },
  19. {
  20. name = 'fov',
  21. type = 'number',
  22. description = 'The field of view (in radians).'
  23. },
  24. {
  25. name = 'aspect',
  26. type = 'number',
  27. description = 'The vertical aspect ratio of the projection.'
  28. }
  29. },
  30. returns = {
  31. {
  32. name = 'm',
  33. type = 'Mat4',
  34. description = 'The original matrix.'
  35. }
  36. },
  37. related = {
  38. 'Mat4:orthographic',
  39. 'Mat4:fov',
  40. 'lovr.graphics.setProjection'
  41. }
  42. }