getOrientation.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. return {
  2. tag = 'input',
  3. summary = 'Get the orientation of a device.',
  4. description = 'Returns the current orientation of a device, in angle/axis form.',
  5. arguments = {
  6. device = {
  7. type = 'Device',
  8. default = [['head']],
  9. description = 'The device to get the orientation of.'
  10. }
  11. },
  12. returns = {
  13. angle = {
  14. type = 'number',
  15. description = 'The amount of rotation around the axis of rotation, in radians.'
  16. },
  17. ax = {
  18. type = 'number',
  19. description = 'The x component of the axis of rotation.'
  20. },
  21. ay = {
  22. type = 'number',
  23. description = 'The y component of the axis of rotation.'
  24. },
  25. az = {
  26. type = 'number',
  27. description = 'The z component of the axis of rotation.'
  28. }
  29. },
  30. variants = {
  31. {
  32. arguments = { 'device' },
  33. returns = { 'angle', 'ax', 'ay', 'az' }
  34. }
  35. },
  36. notes = ' If the device isn\'t tracked, all zeroes will be returned.',
  37. related = {
  38. 'lovr.headset.getPose',
  39. 'lovr.headset.getPosition',
  40. 'lovr.headset.getDirection',
  41. 'lovr.headset.getVelocity',
  42. 'lovr.headset.getAngularVelocity',
  43. 'lovr.headset.isTracked',
  44. 'lovr.headset.getDriver'
  45. }
  46. }