getViewAngles.lua 998 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. {
  11. name = 'view',
  12. type = 'number',
  13. description = 'The view index.'
  14. }
  15. },
  16. returns = {
  17. {
  18. name = 'left',
  19. type = 'number',
  20. description = 'The left view angle, in radians.'
  21. },
  22. {
  23. name = 'right',
  24. type = 'number',
  25. description = 'The right view angle, in radians.'
  26. },
  27. {
  28. name = 'top',
  29. type = 'number',
  30. description = 'The top view angle, in radians.'
  31. },
  32. {
  33. name = 'bottom',
  34. type = 'number',
  35. description = 'The bottom view angle, in radians.'
  36. }
  37. },
  38. related = {
  39. 'lovr.headset.getViewCount',
  40. 'lovr.headset.getViewPose'
  41. }
  42. }