getPose.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. {
  7. name = 'device',
  8. type = 'Device',
  9. default = [['head']],
  10. description = 'The device to get the pose of.'
  11. }
  12. },
  13. returns = {
  14. {
  15. name = 'x',
  16. type = 'number',
  17. description = 'The x position.'
  18. },
  19. {
  20. name = 'y',
  21. type = 'number',
  22. description = 'The y position.'
  23. },
  24. {
  25. name = 'z',
  26. type = 'number',
  27. description = 'The z position.'
  28. },
  29. {
  30. name = 'angle',
  31. type = 'number',
  32. description = 'The amount of rotation around the axis of rotation, in radians.'
  33. },
  34. {
  35. name = 'ax',
  36. type = 'number',
  37. description = 'The x component of the axis of rotation.'
  38. },
  39. {
  40. name = 'ay',
  41. type = 'number',
  42. description = 'The y component of the axis of rotation.'
  43. },
  44. {
  45. name = 'az',
  46. type = 'number',
  47. description = 'The z component of the axis of rotation.'
  48. }
  49. },
  50. notes = [[
  51. Units are in meters.
  52. If the device isn't tracked, all zeroes will be returned.
  53. ]],
  54. related = {
  55. 'lovr.headset.getPosition',
  56. 'lovr.headset.getOrientation',
  57. 'lovr.headset.getVelocity',
  58. 'lovr.headset.getAngularVelocity',
  59. 'lovr.headset.getSkeleton',
  60. 'lovr.headset.isTracked',
  61. 'lovr.headset.getDriver'
  62. }
  63. }