setViewPose.lua 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. return {
  2. tag = 'camera',
  3. summary = 'Set the camera pose.',
  4. description = [[
  5. Sets the pose for a single view. Objects rendered in this view will appear as though the camera
  6. is positioned using the given pose.
  7. Up to 6 views are supported. When rendering to the headset, views are changed to match the eye
  8. positions. These view poses are also available using `lovr.headset.getViewPose`.
  9. ]],
  10. arguments = {
  11. view = {
  12. type = 'number',
  13. description = 'The index of the view to update.'
  14. },
  15. x = {
  16. type = 'number',
  17. description = 'The x position of the viewer, in meters.'
  18. },
  19. y = {
  20. type = 'number',
  21. description = 'The y position of the viewer, in meters.'
  22. },
  23. z = {
  24. type = 'number',
  25. description = 'The z position of the viewer, in meters.'
  26. },
  27. angle = {
  28. type = 'number',
  29. description = 'The number of radians the viewer is rotated around its axis of rotation.'
  30. },
  31. ax = {
  32. type = 'number',
  33. description = 'The x component of the axis of rotation.'
  34. },
  35. ay = {
  36. type = 'number',
  37. description = 'The y component of the axis of rotation.'
  38. },
  39. az = {
  40. type = 'number',
  41. description = 'The z component of the axis of rotation.'
  42. },
  43. position = {
  44. type = 'Vec3',
  45. description = 'The position of the viewer, in meters.'
  46. },
  47. orientation = {
  48. type = 'Quat',
  49. description = 'The orientation of the viewer.'
  50. },
  51. matrix = {
  52. type = 'Mat4',
  53. description = 'A matrix containing the viewer pose.'
  54. },
  55. inverted = {
  56. type = 'boolean',
  57. description = 'Whether the matrix is an inverted pose (a view matrix).'
  58. }
  59. },
  60. returns = {},
  61. variants = {
  62. {
  63. description = 'Set the pose of the view using numbers.',
  64. arguments = { 'view', 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' },
  65. returns = {}
  66. },
  67. {
  68. description = 'Set the pose of the view using vectors.',
  69. arguments = { 'view', 'position', 'orientation' },
  70. returns = {}
  71. },
  72. {
  73. description = 'Set the pose of the view using a matrix.',
  74. arguments = { 'view', 'matrix', 'inverted' },
  75. returns = {}
  76. }
  77. },
  78. related = {
  79. 'lovr.headset.getViewPose',
  80. 'lovr.headset.getViewCount',
  81. 'Pass:getProjection',
  82. 'Pass:setProjection'
  83. }
  84. }