getPosition.lua 995 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. {
  7. name = 'device',
  8. type = 'Device',
  9. default = [['head']],
  10. description = 'The device to get the position of.'
  11. }
  12. },
  13. returns = {
  14. {
  15. name = 'x',
  16. type = 'number',
  17. description = 'The x position of the device.'
  18. },
  19. {
  20. name = 'y',
  21. type = 'number',
  22. description = 'The y position of the device.'
  23. },
  24. {
  25. name = 'z',
  26. type = 'number',
  27. description = 'The z position of the device.'
  28. }
  29. },
  30. notes = ' If the device isn\'t tracked, all zeroes will be returned.',
  31. related = {
  32. 'lovr.headset.getPose',
  33. 'lovr.headset.getOrientation',
  34. 'lovr.headset.getVelocity',
  35. 'lovr.headset.getAngularVelocity',
  36. 'lovr.headset.isTracked',
  37. 'lovr.headset.getDriver'
  38. }
  39. }