getPosition.lua 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. return {
  2. tag = 'input',
  3. summary = 'Get the position of a device.',
  4. description = 'Returns the current position of a device, in meters, relative to the play area.',
  5. arguments = {
  6. device = {
  7. type = 'Device',
  8. default = [['head']],
  9. description = 'The device to get the position of.'
  10. }
  11. },
  12. returns = {
  13. x = {
  14. type = 'number',
  15. description = 'The x position of the device.'
  16. },
  17. y = {
  18. type = 'number',
  19. description = 'The y position of the device.'
  20. },
  21. z = {
  22. type = 'number',
  23. description = 'The z position of the device.'
  24. }
  25. },
  26. variants = {
  27. {
  28. arguments = { 'device' },
  29. returns = { 'x', 'y', 'z' }
  30. }
  31. },
  32. notes = ' If the device isn\'t tracked, all zeroes will be returned.',
  33. related = {
  34. 'lovr.headset.getPose',
  35. 'lovr.headset.getOrientation',
  36. 'lovr.headset.getVelocity',
  37. 'lovr.headset.getAngularVelocity',
  38. 'lovr.headset.isTracked',
  39. 'lovr.headset.getDriver'
  40. }
  41. }