getViewPose.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. {
  11. name = 'view',
  12. type = 'number',
  13. description = 'The view index.'
  14. }
  15. },
  16. returns = {
  17. {
  18. name = 'x',
  19. type = 'number',
  20. description = 'The x coordinate of the view position, in meters.'
  21. },
  22. {
  23. name = 'y',
  24. type = 'number',
  25. description = 'The y coordinate of the view position, in meters.'
  26. },
  27. {
  28. name = 'z',
  29. type = 'number',
  30. description = 'The z coordinate of the view position, in meters.'
  31. },
  32. {
  33. name = 'angle',
  34. type = 'number',
  35. description = 'The amount of rotation around the rotation axis, in radians.'
  36. },
  37. {
  38. name = 'ax',
  39. type = 'number',
  40. description = 'The x component of the axis of rotation.'
  41. },
  42. {
  43. name = 'ay',
  44. type = 'number',
  45. description = 'The y component of the axis of rotation.'
  46. },
  47. {
  48. name = 'az',
  49. type = 'number',
  50. description = 'The z component of the axis of rotation.'
  51. }
  52. },
  53. related = {
  54. 'lovr.headset.getViewCount',
  55. 'lovr.headset.getViewAngles'
  56. }
  57. }