isTracked.lua 742 B

123456789101112131415161718192021222324252627282930
  1. return {
  2. tag = 'input',
  3. summary = 'Check if a device is currently tracked.',
  4. description = [[
  5. Returns whether any active headset driver is currently returning pose information for a device.
  6. ]],
  7. arguments = {
  8. device = {
  9. type = 'Device',
  10. default = [['head']],
  11. description = 'The device to get the pose of.'
  12. }
  13. },
  14. returns = {
  15. tracked = {
  16. type = 'boolean',
  17. description = 'Whether the device is currently tracked.'
  18. }
  19. },
  20. variants = {
  21. {
  22. arguments = { 'device' },
  23. returns = { 'tracked' }
  24. }
  25. },
  26. notes = [[
  27. If a device is tracked, it is guaranteed to return a valid pose until the next call to
  28. `lovr.headset.update`.
  29. ]]
  30. }