Device.lua 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. return {
  2. description = 'Different types of input devices supported by the `lovr.headset` module.',
  3. values = {
  4. {
  5. name = 'head',
  6. description = 'The headset.'
  7. },
  8. {
  9. name = 'floor',
  10. description = [[
  11. A device representing the floor, at the center of the play area. The pose of this device in
  12. physical space will remain constant, even after recentering.
  13. ]]
  14. },
  15. {
  16. name = 'left',
  17. description = 'A shorthand for hand/left.'
  18. },
  19. {
  20. name = 'right',
  21. description = 'A shorthand for hand/right.'
  22. },
  23. {
  24. name = 'hand/left',
  25. description = 'The left hand.'
  26. },
  27. {
  28. name = 'hand/right',
  29. description = 'The right hand.'
  30. },
  31. {
  32. name = 'hand/left/grip',
  33. description = 'The left hand grip pose, used for held objects.'
  34. },
  35. {
  36. name = 'hand/right/grip',
  37. description = 'The right hand grip pose, used for held objects.'
  38. },
  39. {
  40. name = 'hand/left/point',
  41. description = 'The left hand pointer pose, used for pointing or aiming.'
  42. },
  43. {
  44. name = 'hand/right/point',
  45. description = 'The right hand pointer pose, used for pointing or aiming.'
  46. },
  47. {
  48. name = 'hand/left/pinch',
  49. description = [[
  50. The left hand pinch pose between the thumb and index fingers, used for precise, close-range
  51. interactions.
  52. ]]
  53. },
  54. {
  55. name = 'hand/right/pinch',
  56. description = [[
  57. The right hand pinch pose between the thumb and index fingers, used for precise, close-range
  58. interactions.
  59. ]]
  60. },
  61. {
  62. name = 'hand/left/poke',
  63. description = [[
  64. The left hand poke pose, on the tip of the index finger or in front of a controller.
  65. ]]
  66. },
  67. {
  68. name = 'hand/right/poke',
  69. description = [[
  70. The right hand poke pose, on the tip of the index finger or in front of a controller.
  71. ]]
  72. },
  73. {
  74. name = 'elbow/left',
  75. description = 'A device tracking the left elbow.'
  76. },
  77. {
  78. name = 'elbow/right',
  79. description = 'A device tracking the right elbow.'
  80. },
  81. {
  82. name = 'shoulder/left',
  83. description = 'A device tracking the left shoulder.'
  84. },
  85. {
  86. name = 'shoulder/right',
  87. description = 'A device tracking the right shoulder.'
  88. },
  89. {
  90. name = 'chest',
  91. description = 'A device tracking the chest.'
  92. },
  93. {
  94. name = 'waist',
  95. description = 'A device tracking the waist.'
  96. },
  97. {
  98. name = 'knee/left',
  99. description = 'A device tracking the left knee.'
  100. },
  101. {
  102. name = 'knee/right',
  103. description = 'A device tracking the right knee.'
  104. },
  105. {
  106. name = 'foot/left',
  107. description = 'A device tracking the left foot or ankle.'
  108. },
  109. {
  110. name = 'foot/right',
  111. description = 'A device tracking the right foot or ankle.'
  112. },
  113. {
  114. name = 'camera',
  115. description = 'A camera device, often used for recording "mixed reality" footage.'
  116. },
  117. {
  118. name = 'keyboard',
  119. description = 'A tracked keyboard.'
  120. },
  121. {
  122. name = 'eye/left',
  123. description = 'The left eye.'
  124. },
  125. {
  126. name = 'eye/right',
  127. description = 'The right eye.'
  128. },
  129. {
  130. name = 'eye/gaze',
  131. description = [[
  132. The combined eye gaze pose. The position is between the eyes. The orientation aligns the
  133. -Z axis in the direction the user is looking and the +Y axis to the head's "up" vector.
  134. This provides more accurate eye tracking information compared to using the individual eye
  135. devices.
  136. ]]
  137. }
  138. },
  139. notes = [[
  140. The `grip` pose is used to render an object held in the user's hand. It's positioned at
  141. the surface of the palm. The X axis of the grip orientation is perpendicular to the palm,
  142. pointing away from the left palm or into the right palm. If you imagine the hand holding a
  143. stick, the Z axis will be parallel to the stick.
  144. <img src="/img/grip.svg" width="600" alt="Hand Grip Pose" class="flat"/>
  145. *Image from the [OpenXR Specification](https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#_grip_pose)*
  146. ---
  147. The `point` pose is used to aim or point at objects. It's usually positioned slightly in front
  148. of the hand or controller, and is oriented so the -Z axis points in a natural forward direction.
  149. <img src="/img/aim.svg" width="600" alt="Hand Point Pose" class="flat"/>
  150. *Image from the [OpenXR Specification](https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#_aim_pose)*
  151. ---
  152. The `pinch` pose is a stable point between the thumb and index finger on a hand, or a point
  153. slightly in front of a controller. The -Z axis will point forward, away from the hand. It's
  154. good for precise, close-range interaction.
  155. <img src="/img/pinch.svg" width="600" alt="Hand Pinch Pose" class="flat"/>
  156. *Image from the [OpenXR Specification](https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#_pinch_pose)*
  157. ---
  158. The `poke` pose is a position located at the tip of the index finger, or a point slightly in
  159. front of a controller. The -Z axis will point forward out of the tip of the finger, the +Y axis
  160. will be perpendicular to the fingernail.
  161. <img src="/img/poke.svg" width="600" alt="Hand Poke Pose" class="flat"/>
  162. *Image from the [OpenXR Specification](https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#_poke_pose)*
  163. ---
  164. These "hand pose devices" do not report any button input with e.g. `lovr.headset.isDown`. The
  165. main `hand/left` and `hand/right` devices should be used for buttons and haptics.
  166. ]],
  167. related = {
  168. 'DeviceAxis',
  169. 'DeviceButton',
  170. 'lovr.headset.getPose',
  171. 'lovr.headset.getPosition',
  172. 'lovr.headset.getOrientation',
  173. 'lovr.headset.getVelocity',
  174. 'lovr.headset.getAngularVelocity',
  175. 'lovr.headset.getSkeleton',
  176. 'lovr.headset.isTracked',
  177. 'lovr.headset.isDown',
  178. 'lovr.headset.isTouched',
  179. 'lovr.headset.wasPressed',
  180. 'lovr.headset.wasReleased',
  181. 'lovr.headset.getAxis',
  182. 'lovr.headset.vibrate',
  183. 'lovr.headset.animate'
  184. }
  185. }