getViewAngles.lua 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. return {
  2. tag = 'headset',
  3. summary = 'Get the field of view angles of a view.',
  4. description = [[
  5. Returns the view angles of one of the headset views.
  6. These can be used with `Mat4:fov` to create a projection matrix.
  7. If tracking data is unavailable for the view or the index is invalid, `nil` is returned.
  8. ]],
  9. arguments = {
  10. view = {
  11. type = 'number',
  12. description = 'The view index.'
  13. }
  14. },
  15. returns = {
  16. left = {
  17. type = 'number',
  18. description = 'The left view angle, in radians.'
  19. },
  20. right = {
  21. type = 'number',
  22. description = 'The right view angle, in radians.'
  23. },
  24. top = {
  25. type = 'number',
  26. description = 'The top view angle, in radians.'
  27. },
  28. bottom = {
  29. type = 'number',
  30. description = 'The bottom view angle, in radians.'
  31. }
  32. },
  33. variants = {
  34. {
  35. arguments = { 'view' },
  36. returns = { 'left', 'right', 'top', 'bottom' }
  37. }
  38. },
  39. related = {
  40. 'lovr.headset.getViewCount',
  41. 'lovr.headset.getViewPose'
  42. }
  43. }