getVelocity.lua 1010 B

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