getViewPose.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. return {
  2. tag = 'headset',
  3. summary = 'Get the pose of one of the views.',
  4. description = [[
  5. Returns the pose of one of the headset views. This info can be used to create view matrices or
  6. do other eye-dependent calculations.
  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. x = {
  17. type = 'number',
  18. description = 'The x coordinate of the view position, in meters.'
  19. },
  20. y = {
  21. type = 'number',
  22. description = 'The y coordinate of the view position, in meters.'
  23. },
  24. z = {
  25. type = 'number',
  26. description = 'The z coordinate of the view position, in meters.'
  27. },
  28. angle = {
  29. type = 'number',
  30. description = 'The amount of rotation around the rotation axis, in radians.'
  31. },
  32. ax = {
  33. type = 'number',
  34. description = 'The x component of the axis of rotation.'
  35. },
  36. ay = {
  37. type = 'number',
  38. description = 'The y component of the axis of rotation.'
  39. },
  40. az = {
  41. type = 'number',
  42. description = 'The z component of the axis of rotation.'
  43. }
  44. },
  45. variants = {
  46. {
  47. arguments = { 'view' },
  48. returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
  49. }
  50. },
  51. related = {
  52. 'lovr.headset.getViewCount',
  53. 'lovr.headset.getViewAngles'
  54. }
  55. }