setPose.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. return {
  2. tag = 'listener',
  3. summary = 'Set the pose of the listener.',
  4. description = 'Sets the position and orientation of the virtual audio listener.',
  5. arguments = {
  6. {
  7. name = 'x',
  8. type = 'number',
  9. description = 'The x position of the listener, in meters.'
  10. },
  11. {
  12. name = 'y',
  13. type = 'number',
  14. description = 'The y position of the listener, in meters.'
  15. },
  16. {
  17. name = 'z',
  18. type = 'number',
  19. description = 'The z position of the listener, in meters.'
  20. },
  21. {
  22. name = 'angle',
  23. type = 'number',
  24. description = 'The number of radians the listener is rotated around its axis of rotation.'
  25. },
  26. {
  27. name = 'ax',
  28. type = 'number',
  29. description = 'The x component of the axis of rotation.'
  30. },
  31. {
  32. name = 'ay',
  33. type = 'number',
  34. description = 'The y component of the axis of rotation.'
  35. },
  36. {
  37. name = 'az',
  38. type = 'number',
  39. description = 'The z component of the axis of rotation.'
  40. }
  41. },
  42. returns = {},
  43. notes = [[
  44. The default implementation of `lovr.run` calls this function with the result of
  45. `lovr.headset.getPose`, so that the listener automatically tracks the headset.
  46. ]],
  47. related = {
  48. 'lovr.audio.setPosition',
  49. 'lovr.audio.setOrientation',
  50. 'Source:setPose'
  51. }
  52. }