getPose.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. return {
  2. tag = 'input',
  3. summary = 'Get the pose of a device.',
  4. description = 'Returns the current position and orientation of a device.',
  5. arguments = {
  6. device = {
  7. type = 'Device',
  8. default = [['head']],
  9. description = 'The device to get the pose of.'
  10. }
  11. },
  12. returns = {
  13. x = {
  14. type = 'number',
  15. description = 'The x position.'
  16. },
  17. y = {
  18. type = 'number',
  19. description = 'The y position.'
  20. },
  21. z = {
  22. type = 'number',
  23. description = 'The z position.'
  24. },
  25. angle = {
  26. type = 'number',
  27. description = 'The amount of rotation around the axis of rotation, in radians.'
  28. },
  29. ax = {
  30. type = 'number',
  31. description = 'The x component of the axis of rotation.'
  32. },
  33. ay = {
  34. type = 'number',
  35. description = 'The y component of the axis of rotation.'
  36. },
  37. az = {
  38. type = 'number',
  39. description = 'The z component of the axis of rotation.'
  40. }
  41. },
  42. variants = {
  43. {
  44. arguments = { 'device' },
  45. returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
  46. }
  47. },
  48. notes = [[
  49. Units are in meters.
  50. If the device isn't tracked, all zeroes will be returned.
  51. ]],
  52. related = {
  53. 'lovr.headset.getPosition',
  54. 'lovr.headset.getOrientation',
  55. 'lovr.headset.getVelocity',
  56. 'lovr.headset.getAngularVelocity',
  57. 'lovr.headset.getSkeleton',
  58. 'lovr.headset.isTracked',
  59. 'lovr.headset.getDriver'
  60. }
  61. }