getViewPose.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. return {
  2. tag = 'graphicsState',
  3. summary = 'Get the camera pose.',
  4. description = 'Get the pose of a single view.',
  5. arguments = {
  6. view = {
  7. type = 'number',
  8. description = 'The view index.'
  9. },
  10. matrix = {
  11. type = 'Mat4',
  12. description = 'The matrix to fill with the view pose.'
  13. },
  14. invert = {
  15. type = 'boolean',
  16. description = 'Whether the matrix should be inverted.'
  17. }
  18. },
  19. returns = {
  20. x = {
  21. type = 'number',
  22. description = 'The x position of the viewer, in meters.'
  23. },
  24. y = {
  25. type = 'number',
  26. description = 'The y position of the viewer, in meters.'
  27. },
  28. z = {
  29. type = 'number',
  30. description = 'The z position of the viewer, in meters.'
  31. },
  32. angle = {
  33. type = 'number',
  34. description = 'The number of radians the viewer is rotated around its axis of rotation.'
  35. },
  36. ax = {
  37. type = 'number',
  38. description = 'The x component of the axis of rotation.'
  39. },
  40. ay = {
  41. type = 'number',
  42. description = 'The y component of the axis of rotation.'
  43. },
  44. az = {
  45. type = 'number',
  46. description = 'The z component of the axis of rotation.'
  47. },
  48. matrix = {
  49. type = 'Mat4',
  50. description = 'The matrix containing the view pose.'
  51. }
  52. },
  53. variants = {
  54. {
  55. arguments = { 'view' },
  56. returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
  57. },
  58. {
  59. arguments = { 'view', 'matrix', 'invert' },
  60. returns = { 'matrix' }
  61. }
  62. },
  63. related = {
  64. 'lovr.headset.getViewPose',
  65. 'lovr.headset.getViewCount',
  66. 'lovr.graphics.getProjection',
  67. 'lovr.graphics.setProjection'
  68. }
  69. }